The DeadlineProgressManager class acts as an example of how you can implement progress management in your game. There's no general class for that in the engine, for the simple reason that no two games will want to save the exact same things. But this should show you how it's done, and you can then copy and paste that into your own class (or extend this one, whatever you prefer).
More...
|
| override void | Awake () |
| | On awake, we load our progress and initialize our stars counter.
|
| virtual void | LevelComplete () |
| | When a level is completed, we update our progress.
|
| virtual void | InitializeStars () |
| | Goes through all the scenes in our progress list, and updates the collected stars counter.
|
| virtual void | SaveProgress () |
| | Saves the progress to a file.
|
| virtual void | CreateSaveGame () |
| | A test method to create a test save file at any time from the inspector.
|
| virtual void | LoadSavedProgress () |
| | Loads the saved progress into memory.
|
| virtual void | GameOver () |
| | This method describes what happens when the player loses all lives. In this case, we reset its progress and all lives will be reset.
|
| virtual void | ResetLives () |
| | Resets the number of lives to its initial values.
|
| virtual void | OnEnable () |
| | OnEnable, we start listening to events.
|
| virtual void | OnDisable () |
| | OnDisable, we stop listening to events.
|
| virtual void | InitializeSingleton () |
| | Initializes the singleton.
|
The DeadlineProgressManager class acts as an example of how you can implement progress management in your game. There's no general class for that in the engine, for the simple reason that no two games will want to save the exact same things. But this should show you how it's done, and you can then copy and paste that into your own class (or extend this one, whatever you prefer).
◆ Awake()
| override void MoreMountains.TopDownEngine.DeadlineProgressManager.Awake |
( |
| ) |
|
|
protectedvirtual |
◆ CreateSaveGame()
| virtual void MoreMountains.TopDownEngine.DeadlineProgressManager.CreateSaveGame |
( |
| ) |
|
|
protectedvirtual |
A test method to create a test save file at any time from the inspector.
◆ FindCollectible()
| virtual void MoreMountains.TopDownEngine.DeadlineProgressManager.FindCollectible |
( |
string | collectibleName | ) |
|
|
virtual |
◆ GameOver()
| virtual void MoreMountains.TopDownEngine.DeadlineProgressManager.GameOver |
( |
| ) |
|
|
protectedvirtual |
This method describes what happens when the player loses all lives. In this case, we reset its progress and all lives will be reset.
◆ InitializeStars()
| virtual void MoreMountains.TopDownEngine.DeadlineProgressManager.InitializeStars |
( |
| ) |
|
|
protectedvirtual |
Goes through all the scenes in our progress list, and updates the collected stars counter.
◆ InitializeStatics()
| void MoreMountains.TopDownEngine.DeadlineProgressManager.InitializeStatics |
( |
| ) |
|
|
staticprotected |
Statics initialization to support enter play modes.
◆ LevelComplete()
| virtual void MoreMountains.TopDownEngine.DeadlineProgressManager.LevelComplete |
( |
| ) |
|
|
protectedvirtual |
When a level is completed, we update our progress.
◆ LoadSavedProgress()
| virtual void MoreMountains.TopDownEngine.DeadlineProgressManager.LoadSavedProgress |
( |
| ) |
|
|
protectedvirtual |
Loads the saved progress into memory.
◆ OnDisable()
| virtual void MoreMountains.TopDownEngine.DeadlineProgressManager.OnDisable |
( |
| ) |
|
|
protectedvirtual |
OnDisable, we stop listening to events.
◆ OnEnable()
| virtual void MoreMountains.TopDownEngine.DeadlineProgressManager.OnEnable |
( |
| ) |
|
|
protectedvirtual |
OnEnable, we start listening to events.
◆ OnMMEvent() [1/2]
| virtual void MoreMountains.TopDownEngine.DeadlineProgressManager.OnMMEvent |
( |
TopDownEngineEvent | gameEvent | ) |
|
|
virtual |
When we grab a level complete event, we update our status, and save our progress to file.
- Parameters
-
◆ OnMMEvent() [2/2]
| virtual void MoreMountains.TopDownEngine.DeadlineProgressManager.OnMMEvent |
( |
TopDownEngineStarEvent | deadlineStarEvent | ) |
|
|
virtual |
When we grab a star event, we update our scene status accordingly.
- Parameters
-
| deadlineStarEvent | Deadline star event. |
◆ ResetLives()
| virtual void MoreMountains.TopDownEngine.DeadlineProgressManager.ResetLives |
( |
| ) |
|
|
protectedvirtual |
Resets the number of lives to its initial values.
◆ ResetProgress()
| virtual void MoreMountains.TopDownEngine.DeadlineProgressManager.ResetProgress |
( |
| ) |
|
|
virtual |
A method used to remove all save files associated to progress.
◆ SaveProgress()
| virtual void MoreMountains.TopDownEngine.DeadlineProgressManager.SaveProgress |
( |
| ) |
|
|
protectedvirtual |
Saves the progress to a file.
◆ _saveFileName
| const string MoreMountains.TopDownEngine.DeadlineProgressManager._saveFileName = "Progress.data" |
|
staticprotected |
◆ _saveFolderName
| const string MoreMountains.TopDownEngine.DeadlineProgressManager._saveFolderName = "DeadlineProgressData" |
|
staticprotected |
◆ CreateSaveGameBtn
| bool MoreMountains.TopDownEngine.DeadlineProgressManager.CreateSaveGameBtn |
A test button to test creating the save file.
◆ Jules
| Character MoreMountains.TopDownEngine.DeadlineProgressManager.Jules |
◆ Naomi
| Character MoreMountains.TopDownEngine.DeadlineProgressManager.Naomi |
◆ Scenes
| DeadlineScene [] MoreMountains.TopDownEngine.DeadlineProgressManager.Scenes |
the list of scenes that we'll want to consider for our game
◆ CurrentStars
| virtual int MoreMountains.TopDownEngine.DeadlineProgressManager.CurrentStars |
|
getprotected set |
the current amount of collected stars
◆ FoundCollectibles
| virtual List<string> MoreMountains.TopDownEngine.DeadlineProgressManager.FoundCollectibles |
|
getprotected set |
◆ InitialCurrentLives
| virtual int MoreMountains.TopDownEngine.DeadlineProgressManager.InitialCurrentLives |
|
getset |
◆ InitialMaximumLives
| virtual int MoreMountains.TopDownEngine.DeadlineProgressManager.InitialMaximumLives |
|
getset |
The documentation for this class was generated from the following file: