TopDown Engine  v3.6
MoreMountains.TopDownEngine.DeadlineProgressManager Class Reference

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...

Inheritance diagram for MoreMountains.TopDownEngine.DeadlineProgressManager:
MoreMountains.Tools.MMSingleton< DeadlineProgressManager > MoreMountains.Tools.MMEventListener< TopDownEngineEvent > MoreMountains.Tools.MMEventListener< TopDownEngineStarEvent >

Public Member Functions

virtual void FindCollectible (string collectibleName)
 
virtual void OnMMEvent (TopDownEngineStarEvent deadlineStarEvent)
 When we grab a star event, we update our scene status accordingly More...
 
virtual void OnMMEvent (TopDownEngineEvent gameEvent)
 When we grab a level complete event, we update our status, and save our progress to file More...
 
virtual void ResetProgress ()
 A method used to remove all save files associated to progress More...
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< TopDownEngineEvent >
void OnMMEvent (T eventType)
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< TopDownEngineStarEvent >
void OnMMEvent (T eventType)
 

Public Attributes

Character Naomi
 
Character Jules
 
DeadlineScene[] Scenes
 the list of scenes that we'll want to consider for our game More...
 
bool CreateSaveGameBtn
 A test button to test creating the save file. More...
 

Protected Member Functions

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...
 
- Protected Member Functions inherited from MoreMountains.Tools.MMSingleton< DeadlineProgressManager >
virtual void InitializeSingleton ()
 Initializes the singleton. More...
 

Static Protected Member Functions

static void InitializeStatics ()
 Statics initialization to support enter play modes More...
 

Static Protected Attributes

const string _saveFolderName = "DeadlineProgressData"
 
const string _saveFileName = "Progress.data"
 
- Static Protected Attributes inherited from MoreMountains.Tools.MMSingleton< DeadlineProgressManager >
static T _instance
 

Properties

virtual int InitialMaximumLives [get, set]
 
virtual int InitialCurrentLives [get, set]
 
virtual int CurrentStars [get, protected set]
 the current amount of collected stars More...
 
virtual List< string > FoundCollectibles [get, protected set]
 
- Properties inherited from MoreMountains.Tools.MMSingleton< DeadlineProgressManager >
static T Instance [get]
 Singleton design pattern More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MoreMountains.Tools.MMSingleton< DeadlineProgressManager >
static T TryGetInstance ()
 
- Static Public Attributes inherited from MoreMountains.Tools.MMSingleton< DeadlineProgressManager >
static bool HasInstance
 
static T Current
 

Detailed Description

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).

Member Function Documentation

◆ Awake()

override void MoreMountains.TopDownEngine.DeadlineProgressManager.Awake ( )
protectedvirtual

On awake, we load our progress and initialize our stars counter

Reimplemented from MoreMountains.Tools.MMSingleton< DeadlineProgressManager >.

◆ 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()

static 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
gameEventGame event.

◆ 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
deadlineStarEventDeadline 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

Member Data Documentation

◆ _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

Property Documentation

◆ 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: