uLua Paddle Game v2.2.0
A paddle game for Unity made as an example use of the uLua toolkit.
|
Manages all ball, brick, and paddle objects in the scene and keeps track of various game settings. More...
Public Member Functions | |
Ball | GetBall (int i) |
Returns the ball at index i. More... | |
Brick | GetBrick (int i) |
Returns the brick at index i. More... | |
Paddle | GetPaddle (int i) |
Returns the paddle at index i. More... | |
Ball | AddBall (float X, float Y, float Speed, float Delay, string Name="") |
Adds a ball to the scene. More... | |
Brick | AddBrick (float X, float Y, int Health=1, string Name="") |
Adds a brick to the scene. More... | |
Paddle | AddPaddle (float X, float Y, float Speed, float Scale=1f, string Name="") |
Adds a paddle to the scene. More... | |
void | Clear () |
Resets the scene by clearing all loaded objects. More... | |
void | RemoveBrick (Brick Brick) |
Destroys a brick and removes it from the scene. More... | |
void | RemoveBall (Ball Ball) |
Destroys a ball and removes it from the scene. More... | |
void | RemovePaddle (Paddle Paddle) |
Destroys a paddle and removes it from the scene. More... | |
void | ResetPositions () |
Resets the position of all balls and paddles loaded in the scene. More... | |
void | SlowDown (float SpeedIncrement=0f) |
Resets the speed of all balls and paddles loaded in the scene. More... | |
void | SpeedUp (float SpeedIncrement=0f) |
Speeds up all balls and paddles loaded in the scene. More... | |
Protected Member Functions | |
override void | OnExpose () |
Registers events. More... | |
override void | OnDestroy () |
Saves Lua data when the object is destroyed. More... | |
Properties | |
int | NumBalls [get] |
Returns the number of balls currently loaded in the scene. More... | |
int | NumBricks [get] |
Returns the number of bricks currently loaded in the scene. More... | |
int | NumPaddles [get] |
Returns the number of paddles currently loaded in the scene. More... | |
Manages all ball, brick, and paddle objects in the scene and keeps track of various game settings.
All public members of this class are exposed to Lua. Inherits from uLua.ExposedMonoBehaviour
.
|
inline |
Adds a ball to the scene.
This method is exposed to the API.
X,Y | Coordinates of the new ball object. |
Speed | Speed of the new ball object. |
Delay | Time before the ball is set in motion. |
Name | (Optional) Name of the new ball object. |
|
inline |
Adds a brick to the scene.
This method is exposed to the API.
X,Y | Coordinates of the new brick object. |
Health | Health of the new brick object. |
Name | (Optional) Name of the new paddle object. |
|
inline |
Adds a paddle to the scene.
This method is exposed to the API.
X,Y | Coordinates of the new paddle object. |
Speed | Speed of the new paddle object. |
Scale | (Optional) Scale of the new paddle object. |
Name(Optional) | Name of the new paddle object. |
|
inline |
Resets the scene by clearing all loaded objects.
This method is exposed to the API. Destroys all balls, bricks, and paddles and removes them from the scene.
|
inline |
Returns the ball at index i.
This method is exposed to the API.
i | The index of the object. |
|
inline |
Returns the brick at index i.
This method is exposed to the API.
i | The index of the object. |
|
inline |
Returns the paddle at index i.
This method is exposed to the API.
i | The index of the object. |
|
inlineprotected |
Saves Lua data when the object is destroyed.
The "SaveData" field is defined in the Game Lua script in the resource folder.
|
inlineprotected |
Registers events.
The event handlers are defined in the Game Lua script in the resource folder.
|
inline |
|
inline |
|
inline |
|
inline |
Resets the position of all balls and paddles loaded in the scene.
This method is exposed to the API. Used to reset the scene without changing any game settings.
|
inline |
Resets the speed of all balls and paddles loaded in the scene.
This method is exposed to the API.
SpeedIncrement | (Optional) The value (per game level) to be retracted from the ball/paddle speed and paddle scale. |
|
inline |
Speeds up all balls and paddles loaded in the scene.
This method is exposed to the API.
SpeedIncrement | (Optional) The value to be added to ball/paddle speed and paddle scale. |
|
get |
Returns the number of balls currently loaded in the scene.
This property is exposed to the API.
|
get |
Returns the number of bricks currently loaded in the scene.
This property is exposed to the API.
|
get |
Returns the number of paddles currently loaded in the scene.
This property is exposed to the API.