The RetroAdventureProgressManager class acts as an example of how you can implement progress 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 More...
|
|
virtual void | LevelComplete () |
| When a level is completed, we update our progress More...
|
|
virtual void | InitializeStars () |
| Goes through all the scenes in our progress list, and updates the collected stars counter More...
|
|
virtual void | SaveProgress () |
| Saves the progress to a file More...
|
|
virtual void | CreateSaveGame () |
| A test method to create a test save file at any time from the inspector More...
|
|
virtual void | LoadSavedProgress () |
| Loads the saved progress into memory More...
|
|
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. More...
|
|
virtual void | ResetLives () |
| Resets the number of lives to its initial values More...
|
|
virtual void | OnEnable () |
| OnEnable, we start listening to events. More...
|
|
virtual void | OnDisable () |
| OnDisable, we stop listening to events. More...
|
|
virtual void | InitializeSingleton () |
| Initializes the singleton. More...
|
|
The RetroAdventureProgressManager class acts as an example of how you can implement progress 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.CorgiEngine.RetroAdventureProgressManager.Awake |
( |
| ) |
|
|
protectedvirtual |
◆ CreateSaveGame()
virtual void MoreMountains.CorgiEngine.RetroAdventureProgressManager.CreateSaveGame |
( |
| ) |
|
|
protectedvirtual |
A test method to create a test save file at any time from the inspector
◆ GameOver()
virtual void MoreMountains.CorgiEngine.RetroAdventureProgressManager.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.CorgiEngine.RetroAdventureProgressManager.InitializeStars |
( |
| ) |
|
|
protectedvirtual |
Goes through all the scenes in our progress list, and updates the collected stars counter
◆ InitializeStatics()
static void MoreMountains.CorgiEngine.RetroAdventureProgressManager.InitializeStatics |
( |
| ) |
|
|
staticprotected |
Statics initialization to support enter play modes
◆ LevelComplete()
virtual void MoreMountains.CorgiEngine.RetroAdventureProgressManager.LevelComplete |
( |
| ) |
|
|
protectedvirtual |
When a level is completed, we update our progress
◆ LoadSavedProgress()
virtual void MoreMountains.CorgiEngine.RetroAdventureProgressManager.LoadSavedProgress |
( |
| ) |
|
|
protectedvirtual |
Loads the saved progress into memory
◆ OnDisable()
virtual void MoreMountains.CorgiEngine.RetroAdventureProgressManager.OnDisable |
( |
| ) |
|
|
protectedvirtual |
OnDisable, we stop listening to events.
◆ OnEnable()
virtual void MoreMountains.CorgiEngine.RetroAdventureProgressManager.OnEnable |
( |
| ) |
|
|
protectedvirtual |
OnEnable, we start listening to events.
◆ OnMMEvent() [1/2]
virtual void MoreMountains.CorgiEngine.RetroAdventureProgressManager.OnMMEvent |
( |
CorgiEngineEvent |
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.CorgiEngine.RetroAdventureProgressManager.OnMMEvent |
( |
CorgiEngineStarEvent |
corgiStarEvent | ) |
|
|
virtual |
When we grab a star event, we update our scene status accordingly
- Parameters
-
corgiStarEvent | Corgi star event. |
◆ ResetLives()
virtual void MoreMountains.CorgiEngine.RetroAdventureProgressManager.ResetLives |
( |
| ) |
|
|
protectedvirtual |
Resets the number of lives to its initial values
◆ ResetProgress()
virtual void MoreMountains.CorgiEngine.RetroAdventureProgressManager.ResetProgress |
( |
| ) |
|
|
virtual |
A method used to remove all save files associated to progress
◆ SaveProgress()
virtual void MoreMountains.CorgiEngine.RetroAdventureProgressManager.SaveProgress |
( |
| ) |
|
|
protectedvirtual |
Saves the progress to a file
◆ _saveFileName
const string MoreMountains.CorgiEngine.RetroAdventureProgressManager._saveFileName = "Progress.data" |
|
staticprotected |
◆ _saveFolderName
const string MoreMountains.CorgiEngine.RetroAdventureProgressManager._saveFolderName = "MMRetroAdventureProgress" |
|
staticprotected |
◆ CreateSaveGameBtn
bool MoreMountains.CorgiEngine.RetroAdventureProgressManager.CreateSaveGameBtn |
A button to test creating the save file.
◆ Scenes
the list of scenes that we'll want to consider for our game
◆ CurrentStars
float MoreMountains.CorgiEngine.RetroAdventureProgressManager.CurrentStars |
|
getprotected set |
the current amount of collected stars
◆ InitialCurrentLives
int MoreMountains.CorgiEngine.RetroAdventureProgressManager.InitialCurrentLives |
|
getset |
◆ InitialMaximumLives
int MoreMountains.CorgiEngine.RetroAdventureProgressManager.InitialMaximumLives |
|
getset |
The documentation for this class was generated from the following file: