The game manager is a persistent singleton that handles points and time.
More...
|
| 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.
|
| virtual void | Reset () |
| | this method resets the whole game manager
|
| virtual void | AutoIncrementScore (bool status) |
| | Starts or stops the autoincrement of the score.
|
| virtual void | AddPoints (float pointsToAdd) |
| | Adds the points in parameters to the current game points.
|
| virtual void | SetPoints (float points) |
| | use this to set the current points to the one you pass as a parameter
|
| virtual void | SetLives (int lives) |
| | use this to set the number of lives currently available
|
| virtual void | LoseLives (int lives) |
| | use this to remove lives from the current amount
|
| virtual void | SetTimeScale (float newTimeScale) |
| | sets the timescale to the one in parameters
|
| virtual void | ResetTimeScale () |
| | Resets the time scale to the last saved time scale.
|
| virtual void | Pause () |
| | Pauses the game.
|
| virtual void | UnPause () |
| | Unpauses the game.
|
|
| virtual void | Start () |
| | Initialization.
|
| 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.
|
| virtual void | OnApplicationQuit () |
| virtual void | Awake () |
| | On awake, we initialize our instance. Make sure to call base.Awake() in override if you need awake.
|
| virtual void | InitializeSingleton () |
| | Initializes the singleton.
|
|
| int | CurrentLives [get, protected set] |
| | The current number of lives.
|
| float | Points [get, protected set] |
| | the current number of game points
|
| GameStatus | Status [get, protected set] |
| | the current status of the game
|
| static bool | HasInstance [get] |
| static T | Current [get] |
| static T | Instance [get] |
| | Singleton design pattern.
|
The game manager is a persistent singleton that handles points and time.
◆ GameStatus
the various states the game can be in
| Enumerator |
|---|
| BeforeGameStart | |
| GameInProgress | |
| Paused | |
| GameOver | |
| LifeLost | |
| GoalReached | |
◆ AddPoints()
| virtual void MoreMountains.InfiniteRunnerEngine.GameManager.AddPoints |
( |
float | pointsToAdd | ) |
|
|
virtual |
Adds the points in parameters to the current game points.
- Parameters
-
| pointsToAdd | Points to add. |
◆ AutoIncrementScore()
| virtual void MoreMountains.InfiniteRunnerEngine.GameManager.AutoIncrementScore |
( |
bool | status | ) |
|
|
virtual |
Starts or stops the autoincrement of the score.
- Parameters
-
| status | If set to true autoincrements the score, if set to false, stops the autoincrementation. |
◆ GameManagerInspectorRedraw()
| delegate void MoreMountains.InfiniteRunnerEngine.GameManager.GameManagerInspectorRedraw |
( |
| ) |
|
◆ IncrementScore()
| virtual IEnumerator MoreMountains.InfiniteRunnerEngine.GameManager.IncrementScore |
( |
| ) |
|
|
protectedvirtual |
Each 0.01 second, increments the score by 1/100th of the number of points it's supposed to increase each second.
- Returns
- The score.
◆ LoseLives()
| virtual void MoreMountains.InfiniteRunnerEngine.GameManager.LoseLives |
( |
int | lives | ) |
|
|
virtual |
use this to remove lives from the current amount
- Parameters
-
| lives | the number of lives you want to lose. |
◆ OnApplicationQuit()
| virtual void MoreMountains.InfiniteRunnerEngine.GameManager.OnApplicationQuit |
( |
| ) |
|
|
protectedvirtual |
◆ Pause()
| virtual void MoreMountains.InfiniteRunnerEngine.GameManager.Pause |
( |
| ) |
|
|
virtual |
◆ Reset()
| virtual void MoreMountains.InfiniteRunnerEngine.GameManager.Reset |
( |
| ) |
|
|
virtual |
this method resets the whole game manager
◆ ResetTimeScale()
| virtual void MoreMountains.InfiniteRunnerEngine.GameManager.ResetTimeScale |
( |
| ) |
|
|
virtual |
Resets the time scale to the last saved time scale.
◆ SetLives()
| virtual void MoreMountains.InfiniteRunnerEngine.GameManager.SetLives |
( |
int | lives | ) |
|
|
virtual |
use this to set the number of lives currently available
- Parameters
-
| lives | the new number of lives. |
◆ SetPoints()
| virtual void MoreMountains.InfiniteRunnerEngine.GameManager.SetPoints |
( |
float | points | ) |
|
|
virtual |
use this to set the current points to the one you pass as a parameter
- Parameters
-
◆ SetPointsPerSecond()
| virtual void MoreMountains.InfiniteRunnerEngine.GameManager.SetPointsPerSecond |
( |
float | newPointsPerSecond | ) |
|
|
virtual |
◆ SetStatus()
| virtual void MoreMountains.InfiniteRunnerEngine.GameManager.SetStatus |
( |
GameStatus | newStatus | ) |
|
|
virtual |
Sets the status. Status can be accessed by other classes to check if the game is paused, starting, etc.
- Parameters
-
◆ SetTimeScale()
| virtual void MoreMountains.InfiniteRunnerEngine.GameManager.SetTimeScale |
( |
float | newTimeScale | ) |
|
|
virtual |
sets the timescale to the one in parameters
- Parameters
-
| newTimeScale | New time scale. |
◆ Start()
| virtual void MoreMountains.InfiniteRunnerEngine.GameManager.Start |
( |
| ) |
|
|
protectedvirtual |
◆ UnPause()
| virtual void MoreMountains.InfiniteRunnerEngine.GameManager.UnPause |
( |
| ) |
|
|
virtual |
◆ _autoIncrementCoroutine
| Coroutine MoreMountains.InfiniteRunnerEngine.GameManager._autoIncrementCoroutine |
|
protected |
◆ _pointsPerSecond
| float MoreMountains.InfiniteRunnerEngine.GameManager._pointsPerSecond |
|
protected |
◆ _savedTimeScale
| float MoreMountains.InfiniteRunnerEngine.GameManager._savedTimeScale |
|
protected |
◆ _scoreCoroutine
| IEnumerator MoreMountains.InfiniteRunnerEngine.GameManager._scoreCoroutine |
|
protected |
◆ _statusBeforePause
| GameStatus MoreMountains.InfiniteRunnerEngine.GameManager._statusBeforePause |
|
protected |
◆ TimeScale
| float MoreMountains.InfiniteRunnerEngine.GameManager.TimeScale = 1 |
◆ TotalLives
| 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.
◆ CurrentLives
| int MoreMountains.InfiniteRunnerEngine.GameManager.CurrentLives |
|
getprotected set |
The current number of lives.
◆ Points
| float MoreMountains.InfiniteRunnerEngine.GameManager.Points |
|
getprotected set |
the current number of game points
◆ Status
| GameStatus MoreMountains.InfiniteRunnerEngine.GameManager.Status |
|
getprotected set |
the current status of the game
◆ GameManagerInspectorNeedRedraw
The documentation for this class was generated from the following file: