Infinite Runner Engine v1.9
|
The game manager is a persistent singleton that handles points and time More...
Public Types | |
enum | GameStatus { BeforeGameStart , GameInProgress , Paused , GameOver , LifeLost , GoalReached } |
the various states the game can be in More... | |
Public Member Functions | |
delegate void | GameManagerInspectorRedraw () |
virtual void | SetPointsPerSecond (float newPointsPerSecond) |
virtual void | SetStatus (GameStatus newStatus) |
Sets the status. Status can be accessed by other classes to check if the game is paused, starting, etc More... | |
virtual void | Reset () |
this method resets the whole game manager More... | |
virtual void | AutoIncrementScore (bool status) |
Starts or stops the autoincrement of the score More... | |
virtual void | AddPoints (float pointsToAdd) |
Adds the points in parameters to the current game points. More... | |
virtual void | SetPoints (float points) |
use this to set the current points to the one you pass as a parameter More... | |
virtual void | SetLives (int lives) |
use this to set the number of lives currently available More... | |
virtual void | LoseLives (int lives) |
use this to remove lives from the current amount More... | |
virtual void | SetTimeScale (float newTimeScale) |
sets the timescale to the one in parameters More... | |
virtual void | ResetTimeScale () |
Resets the time scale to the last saved time scale. More... | |
virtual void | Pause () |
Pauses the game More... | |
virtual void | UnPause () |
Unpauses the game More... | |
Public Attributes | |
int | TotalLives = 3 |
float | TimeScale = 1 |
the current time scale More... | |
Protected Member Functions | |
virtual void | Start () |
Initialization More... | |
virtual IEnumerator | IncrementScore () |
Each 0.01 second, increments the score by 1/100th of the number of points it's supposed to increase each second More... | |
virtual void | OnApplicationQuit () |
Protected Member Functions inherited from MoreMountains.Tools.MMSingleton< GameManager > | |
virtual void | Awake () |
On awake, we initialize our instance. Make sure to call base.Awake() in override if you need awake. More... | |
Protected Attributes | |
float | _savedTimeScale |
IEnumerator | _scoreCoroutine |
float | _pointsPerSecond |
GameStatus | _statusBeforePause |
Coroutine | _autoIncrementCoroutine |
Properties | |
int | CurrentLives [getprotected set] |
The current number of lives. More... | |
float | Points [getprotected set] |
the current number of game points More... | |
GameStatus | Status [getprotected set] |
the current status of the game More... | |
Properties inherited from MoreMountains.Tools.MMSingleton< GameManager > | |
static bool | HasInstance [get] |
static T | Current [get] |
static T | Instance [get] |
Singleton design pattern More... | |
Events | |
GameManagerInspectorRedraw | GameManagerInspectorNeedRedraw |
Additional Inherited Members | |
Static Public Member Functions inherited from MoreMountains.Tools.MMSingleton< GameManager > | |
static T | TryGetInstance () |
Static Protected Attributes inherited from MoreMountains.Tools.MMSingleton< GameManager > | |
static T | _instance |
The game manager is a persistent singleton that handles points and time
|
virtual |
Adds the points in parameters to the current game points.
pointsToAdd | Points to add. |
|
virtual |
Starts or stops the autoincrement of the score
status | If set to true autoincrements the score, if set to false, stops the autoincrementation. |
delegate void MoreMountains.InfiniteRunnerEngine.GameManager.GameManagerInspectorRedraw | ( | ) |
|
protectedvirtual |
Each 0.01 second, increments the score by 1/100th of the number of points it's supposed to increase each second
|
virtual |
use this to remove lives from the current amount
lives | the number of lives you want to lose. |
|
protectedvirtual |
|
virtual |
Pauses the game
|
virtual |
this method resets the whole game manager
|
virtual |
Resets the time scale to the last saved time scale.
|
virtual |
use this to set the number of lives currently available
lives | the new number of lives. |
|
virtual |
use this to set the current points to the one you pass as a parameter
points | Points. |
|
virtual |
|
virtual |
Sets the status. Status can be accessed by other classes to check if the game is paused, starting, etc
newStatus | New status. |
|
virtual |
sets the timescale to the one in parameters
newTimeScale | New time scale. |
|
protectedvirtual |
Initialization
|
virtual |
Unpauses the game
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
float MoreMountains.InfiniteRunnerEngine.GameManager.TimeScale = 1 |
the current time scale
int MoreMountains.InfiniteRunnerEngine.GameManager.TotalLives = 3 |
the number of lives the player gets (you lose a life when your character (or your characters all) die. lose all lives you lose the game and your points.
|
getprotected set |
The current number of lives.
|
getprotected set |
the current number of game points
|
getprotected set |
the current status of the game
GameManagerInspectorRedraw MoreMountains.InfiniteRunnerEngine.GameManager.GameManagerInspectorNeedRedraw |