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