TopDown Engine v4.5
Loading...
Searching...
No Matches
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< T > MoreMountains.Tools.MMEventListener< T > MoreMountains.Tools.MMEventListener< T > MoreMountains.Tools.MMEventListenerBase MoreMountains.Tools.MMEventListenerBase

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.
virtual void OnMMEvent (TopDownEngineEvent gameEvent)
 When we grab a level complete event, we update our status, and save our progress to file.
virtual void ResetProgress ()
 A method used to remove all save files associated to progress.
Public Member Functions inherited from MoreMountains.Tools.MMEventListener< T >
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
bool CreateSaveGameBtn
 A test button to test creating the save file.

Protected Member Functions

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

Static Protected Member Functions

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

Static Protected Attributes

const string _saveFolderName = "DeadlineProgressData"
const string _saveFileName = "Progress.data"
Static Protected Attributes inherited from MoreMountains.Tools.MMSingleton< T >
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
virtual List< string > FoundCollectibles [get, protected set]
Properties inherited from MoreMountains.Tools.MMSingleton< T >
static bool HasInstance [get]
static T Current [get]
static T Instance [get]
 Singleton design pattern.

Additional Inherited Members

Static Public Member Functions inherited from MoreMountains.Tools.MMSingleton< T >
static T TryGetInstance ()

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

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