![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
Very simple class for managing a basic score or statistic. More...
Public Member Functions | |
void | AddScore (int amount) |
Adds to the score. Use a negative number to subtract. More... | |
void | ResetScore () |
Resets the score. More... | |
Static Public Member Functions | |
static ScoreManager | GetInstanceForType (string scoreType) |
Get the instance More... | |
static void | PersistScores (string scoreType, bool persist) |
Call this to change persistence for the given score manager. By default scores are not saved so will be reset when player exits the game. More... | |
Public Attributes | |
string | scoreType |
The type of the score. More... | |
bool | saveScoreToPreferences |
Should we save the score? More... | |
Protected Member Functions | |
void | OnScoreChanged (int change) |
Raises the score changed event. More... | |
void | Init (string scoreType) |
Init the instance. More... | |
virtual void | Save () |
Save the score to player prefs, override if you want to save elsewhere. More... | |
virtual void | Load () |
Load the score from player prefs, override if you want to load from elsewhere. More... | |
Static Protected Member Functions | |
static ScoreManager | CreateNewScoreManager (string scoreType) |
Creates the score manager. More... | |
Protected Attributes | |
int | currentScore |
Stores the current score. More... | |
ScoreEventArgs | scoreEventArgs |
Cached copy of the score event args. More... | |
Static Protected Attributes | |
const string | PP_SCORE_ID = "PP_SCOREMANAGER" |
Uniqifier for the save player prefs key. More... | |
static List< ScoreManager > | instances |
The score managers. More... | |
static List< string > | instanceTypes |
The score manager types corresponds to the order of score managers. More... | |
Properties | |
int | Score [get] |
Gets the score. More... | |
Events | |
System.EventHandler< ScoreEventArgs > | ScoreChanged |
Occurs when score changes. More... | |
Very simple class for managing a basic score or statistic.
void PlatformerPro.ScoreManager.AddScore | ( | int | amount | ) |
Adds to the score. Use a negative number to subtract.
amount | Amount. |
|
staticprotected |
Creates the score manager.
|
static |
Get the instance
|
protected |
Init the instance.
scoreType | Score type. |
|
protectedvirtual |
Load the score from player prefs, override if you want to load from elsewhere.
|
protected |
Raises the score changed event.
change | Change. |
|
static |
Call this to change persistence for the given score manager. By default scores are not saved so will be reset when player exits the game.
scoreType | Score type. |
persist | If set to true then persist, otherwise don't. |
void PlatformerPro.ScoreManager.ResetScore | ( | ) |
Resets the score.
|
protectedvirtual |
Save the score to player prefs, override if you want to save elsewhere.
|
protected |
Stores the current score.
|
staticprotected |
The score managers.
|
staticprotected |
The score manager types corresponds to the order of score managers.
|
staticprotected |
Uniqifier for the save player prefs key.
bool PlatformerPro.ScoreManager.saveScoreToPreferences |
Should we save the score?
|
protected |
Cached copy of the score event args.
string PlatformerPro.ScoreManager.scoreType |
The type of the score.
|
get |
Gets the score.
The score.
System.EventHandler<ScoreEventArgs> PlatformerPro.ScoreManager.ScoreChanged |
Occurs when score changes.