|
TopDown Engine v4.5
|
The game manager is a persistent singleton that handles points and time. More...
Public Member Functions | |
| virtual void | Reset () |
| this method resets the whole game manager | |
| virtual void | LoseLife () |
| Use this method to decrease the current number of lives. | |
| virtual void | GainLives (int lives) |
| Use this method when a life (or more) is gained. | |
| virtual void | AddLives (int lives, bool increaseCurrent) |
| Use this method to increase the max amount of lives, and optionnally the current amount as well. | |
| virtual void | ResetLives () |
| Resets the number of lives to their initial values. | |
| virtual void | AddPoints (int pointsToAdd) |
| Adds the points in parameters to the current game points. | |
| virtual void | SetPoints (int points) |
| use this to set the current points to the one you pass as a parameter | |
| virtual void | Pause (PauseMethods pauseMethod=PauseMethods.PauseMenu, bool unpauseIfPaused=true) |
| Pauses the game or unpauses it depending on the current state. | |
| virtual void | UnPause (PauseMethods pauseMethod=PauseMethods.PauseMenu) |
| Unpauses the game. | |
| virtual void | StorePointsOfEntry (string levelName, int entryIndex, Character.FacingDirections facingDirection) |
| Stores the points of entry for the level whose name you pass as a parameter. | |
| virtual PointsOfEntryStorage | GetPointsOfEntry (string levelName) |
| Gets point of entry info for the level whose scene name you pass as a parameter. | |
| virtual void | ClearPointOfEntry (string levelName) |
| Clears the stored point of entry infos for the level whose name you pass as a parameter. | |
| virtual void | ClearAllPointsOfEntry () |
| Clears all points of entry. | |
| virtual void | ResetAllSaves () |
| Deletes all save files. | |
| virtual void | StoreSelectedCharacter (Character selectedCharacter) |
| Stores the selected character for use in upcoming levels. | |
| virtual void | ClearSelectedCharacter () |
| Clears the selected character. | |
| virtual void | SetPersistentCharacter (Character newCharacter) |
| Sets a new persistent character. | |
| virtual void | DestroyPersistentCharacter () |
| Destroys a persistent character if there's one. | |
| virtual void | OnMMEvent (MMGameEvent gameEvent) |
| Catches MMGameEvents and acts on them, playing the corresponding sounds. | |
| virtual void | OnMMEvent (TopDownEngineEvent engineEvent) |
| Catches TopDownEngineEvents and acts on them, playing the corresponding sounds. | |
| virtual void | OnMMEvent (TopDownEnginePointEvent pointEvent) |
| Catches TopDownEnginePointsEvents and acts on them, playing the corresponding sounds. | |
| Public Member Functions inherited from MoreMountains.Tools.MMEventListener< T > | |
| void | OnMMEvent (T eventType) |
Public Attributes | |
| int | TargetFrameRate = 300 |
| the target frame rate for the game | |
| int | MaximumLives = 0 |
| the maximum amount of lives the character can currently have | |
| int | CurrentLives = 0 |
| the current number of lives | |
| string | GameOverScene |
| the name of the scene to redirect to when all lives are lost | |
| int | Points |
| the current number of game points | |
| bool | PauseGameWhenInventoryOpens = true |
| if this is true, the game will automatically pause when opening an inventory | |
| List< PointsOfEntryStorage > | PointsOfEntry |
| the list of points of entry and exit | |
| Public Attributes inherited from MoreMountains.Tools.MMPersistentSingleton< T > | |
| bool | AutomaticallyUnparentOnAwake = true |
| if this is true, this singleton will auto detach if it finds itself parented on awake | |
Protected Member Functions | |
| override void | Awake () |
| On Awake we initialize our list of points of entry. | |
| virtual void | Start () |
| On Start(), sets the target framerate to whatever's been specified. | |
| virtual void | SetActiveInventoryInputManager (bool status) |
| Enables the inventory input manager if found. | |
| virtual void | OnEnable () |
| OnDisable, we start listening to events. | |
| virtual void | OnDisable () |
| OnDisable, we stop listening to events. | |
| Protected Member Functions inherited from MoreMountains.Tools.MMPersistentSingleton< T > | |
| virtual void | InitializeSingleton () |
| Initializes the singleton. | |
Protected Attributes | |
| bool | _inventoryOpen = false |
| bool | _pauseMenuOpen = false |
| InventoryInputManager | _inventoryInputManager |
| int | _initialMaximumLives |
| int | _initialCurrentLives |
| Protected Attributes inherited from MoreMountains.Tools.MMPersistentSingleton< T > | |
| bool | _enabled |
Properties | |
| virtual bool | Paused [get, set] |
| true if the game is currently paused | |
| virtual bool | StoredLevelMapPosition [get, set] |
| virtual Vector2 | LevelMapPosition [get, set] |
| the current player | |
| virtual Character | PersistentCharacter [get, set] |
| the stored selected character | |
| virtual Character | StoredCharacter [get, set] |
| the stored selected character | |
| Properties inherited from MoreMountains.Tools.MMPersistentSingleton< T > | |
| static bool | HasInstance [get] |
| static T | Current [get] |
| static T | Instance [get] |
| Singleton design pattern. | |
Additional Inherited Members | |
| Static Protected Attributes inherited from MoreMountains.Tools.MMPersistentSingleton< T > | |
| static T | _instance |
The game manager is a persistent singleton that handles points and time.
|
virtual |
Use this method to increase the max amount of lives, and optionnally the current amount as well.
| lives | Lives. |
| increaseCurrent | If set to true increase current. |
|
virtual |
Adds the points in parameters to the current game points.
| pointsToAdd | Points to add. |
|
protectedvirtual |
On Awake we initialize our list of points of entry.
Reimplemented from MoreMountains.Tools.MMPersistentSingleton< T >.
|
virtual |
Clears all points of entry.
|
virtual |
Clears the stored point of entry infos for the level whose name you pass as a parameter.
| levelName | Level name. |
|
virtual |
Clears the selected character.
|
virtual |
Destroys a persistent character if there's one.
|
virtual |
Use this method when a life (or more) is gained.
| lives | Lives. |
|
virtual |
Gets point of entry info for the level whose scene name you pass as a parameter.
| levelName | Level name. |
|
virtual |
Use this method to decrease the current number of lives.
|
protectedvirtual |
OnDisable, we stop listening to events.
|
protectedvirtual |
OnDisable, we start listening to events.
|
virtual |
Catches MMGameEvents and acts on them, playing the corresponding sounds.
| gameEvent | MMGameEvent event. |
|
virtual |
Catches TopDownEngineEvents and acts on them, playing the corresponding sounds.
| engineEvent | TopDownEngineEvent event. |
|
virtual |
Catches TopDownEnginePointsEvents and acts on them, playing the corresponding sounds.
| pointEvent | TopDownEnginePointEvent event. |
|
virtual |
Pauses the game or unpauses it depending on the current state.
|
virtual |
this method resets the whole game manager
|
virtual |
Deletes all save files.
|
virtual |
Resets the number of lives to their initial values.
|
protectedvirtual |
Enables the inventory input manager if found.
| status |
|
virtual |
Sets a new persistent character.
| newCharacter |
|
virtual |
use this to set the current points to the one you pass as a parameter
| points | Points. |
|
protectedvirtual |
On Start(), sets the target framerate to whatever's been specified.
|
virtual |
Stores the points of entry for the level whose name you pass as a parameter.
| levelName | Level name. |
| entryIndex | Entry index. |
| exitIndex | Exit index. |
|
virtual |
Stores the selected character for use in upcoming levels.
| selectedCharacter | Selected character. |
|
virtual |
Unpauses the game.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| int MoreMountains.TopDownEngine.GameManager.CurrentLives = 0 |
the current number of lives
| string MoreMountains.TopDownEngine.GameManager.GameOverScene |
the name of the scene to redirect to when all lives are lost
| int MoreMountains.TopDownEngine.GameManager.MaximumLives = 0 |
the maximum amount of lives the character can currently have
| bool MoreMountains.TopDownEngine.GameManager.PauseGameWhenInventoryOpens = true |
if this is true, the game will automatically pause when opening an inventory
| int MoreMountains.TopDownEngine.GameManager.Points |
the current number of game points
| List<PointsOfEntryStorage> MoreMountains.TopDownEngine.GameManager.PointsOfEntry |
the list of points of entry and exit
| int MoreMountains.TopDownEngine.GameManager.TargetFrameRate = 300 |
the target frame rate for the game
|
getset |
the current player
|
getset |
true if the game is currently paused
|
getset |
the stored selected character
|
getset |
the stored selected character
|
getset |