![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
Manages respawning and respawn points. More...
Public Member Functions | |
void | Exit () |
Exit the scene. More... | |
virtual void | LevelCompleted () |
Indicates level is complete. More... | |
virtual void | LoadScene (string sceneName) |
Load the given scene. More... | |
virtual void | EnableRespawnPoint (string respawnPoint) |
Enables a spawn point but doesn't set it as active. More... | |
virtual void | ActivateRespawnPoint (string respawnPoint) |
Enables and actiavtes the respawn point. More... | |
virtual void | Respawn (Character character) |
Respawn the specified character at the currently active reswpawn point. More... | |
virtual void | Respawn (Character character, string respawnPoint) |
Respawn the specified character at the specified respawn point. More... | |
virtual void | ClearRespawns () |
Clear all respawn points (but dont reset level locks). More... | |
virtual void | UnlockLevel (string levelKey) |
Unlocks the given level (or object). More... | |
virtual void | UnlockLevel (string levelKey, int completeRating) |
Unlocks the given level (or object) and Sets a complete rating (i.e. snumber of stars, percentage, etc). More... | |
virtual void | LockLevel (string levelKey) |
Unlocks the given level (or object). More... | |
virtual bool | IsUnlocked (string levelKey) |
Check if the given level (or other object) is unlocked. More... | |
virtual int | Rating (string levelKey) |
override void | ApplySaveData (object t) |
Applies the save data to the object. More... | |
override System.Type | SavedObjectType () |
Get the type of object this Persistable saves. More... | |
override void | ResetSaveData () |
Resets the save data back to default. More... | |
![]() | |
virtual System.Type[] | GetExtraTypes () |
Support complex object serialisation by passing additional types to seralizer. More... | |
![]() | |
virtual void | Validate (PlatformerProMonoBehaviour myTarget) |
Override this method if you want to provide custom validation. The actual code should be surrounded by the if UNITY_EDITOR / endif directive. More... | |
Public Attributes | |
string | levelName |
Name of the current level More... | |
bool | unlockLevelOnComplete = true |
Unlock the level name automatically when level completes. More... | |
string | sceneToLoadOnLevelComplete |
Should we automatically load another scene on level complete. Leave blank if there is a level complete screen which will do the loading. More... | |
bool | clearRespawnsOnComplete = true |
Should we clear all respawn points for this level on level complete? More... | |
string | exitMenuScene |
Scene to load when user exits level select. More... | |
bool | saveSceneName = false |
Should we save the name of the sceen to the saved scene data? More... | |
![]() | |
bool | usePersistenceDefaults = true |
Should we use the persistence defaults or override with our own values. More... | |
bool | enablePersistence = true |
Should we enable persistence. More... | |
bool | saveOnAnyChange |
Save whenever this value changes (Note: not supported by all objects). More... | |
PersistenceResetType | persistenceType |
When do we reset persistence? More... | |
Static Public Attributes | |
const string | PLAYER_PREF_KEY = "LevelManager" |
Const key to append in front of level lock string. More... | |
![]() | |
const string | BasePlayerPrefId = "PP.Persistent." |
The base player preference identifier. More... | |
Protected Member Functions | |
virtual void | OnRespawned (Character character, int playerId, string respawnPoint) |
Raises the respawned event. More... | |
virtual void | OnSceneLoaded () |
Raises the scene loaded event on Start. More... | |
virtual void | OnLevelComplete (string levelName) |
Raises the level complete event. More... | |
virtual void | OnWillExitScene (string newLevelName) |
Raises the level complete event. More... | |
virtual void | Init () |
virtual void | HandlePhaseChange (object sender, GamePhaseEventArgs e) |
virtual void | HandleCharacterLoaded (object sender, CharacterEventArgs e) |
Handles the character loaded event by setting the character. More... | |
virtual void | DoDestroy () |
Do the destroy actions. More... | |
![]() | |
virtual void | OnLoaded () |
Raises the loaded event. More... | |
virtual void | ConfigureEventListeners () |
Init this instance. More... | |
virtual void | DoPendingSaves (object sender, PersistenceEventArgs e) |
Trigger any pending saves. More... | |
virtual void | PhaseChange (object sender, GamePhaseEventArgs e) |
Handle a change of game phase, look for persistence event and apply. More... | |
virtual void | HandleRespawn (object sender, CharacterEventArgs e) |
Handle a change of game phase, look for persistence event and apply. More... | |
virtual void | HandleWillExitScene (object sender, SceneEventArgs e) |
Handles the will exit scene event More... | |
virtual void | HandleGameOver (object sender, CharacterEventArgs e) |
Handles the game over event More... | |
virtual void | HandleDied (object sender, DamageInfoEventArgs e) |
Handles the died event. More... | |
Static Protected Member Functions | |
static void | CreateNewLevelManager () |
Creates the level manager. More... | |
![]() | |
static object | LoadSavedDataXml (Persistable p) |
Does the actual load and returns raw object. More... | |
static object | LoadSavedDataBinary (Persistable p) |
Does the actual load and returns raw object. More... | |
Protected Attributes | |
string | activeRespawnPoint |
The currently active respawn point identifier. More... | |
List< string > | enabledRespawnPoints |
List of all enabled respawn points. More... | |
List< LevelLockData > | levelLockData |
The level lock data. More... | |
Character | character |
Character to use for persistence events. Generally this is for resetting locks on game over. More... | |
string | lastEnteredScene |
Stores the SceneManager name of the last entered scene. More... | |
![]() | |
bool | loaded |
Have we loaded the data yet? More... | |
bool | readyToSave |
Are we ready to save on the next save tick? More... | |
Persistable | latestSaveData |
Data to save when we trigger the next save tick. More... | |
Static Protected Attributes | |
static bool | sceneLoadedEvent |
Have we called the scene loaded event for this scene? Used to ensure we only call scene loaded once when the first character is loaded. More... | |
static LevelManager | instance |
The instance. More... | |
Properties | |
bool | IsActive [get] |
Has a respawn point been set? More... | |
string | ActiveRespawnPoint [get] |
Return the active resapwn point More... | |
List< string > | EnabledRespawnPoints [get] |
Get a copy of the list of enabled respawn points. More... | |
override string | PlayerPrefsIdentifier [get] |
The player preference identifier. More... | |
static LevelManager | Instance [get, protected set] |
Gets a reference to this object. More... | |
static string | PreviousLevel [get, set] |
Keeps track of the previous level. More... | |
override Character | Character [get, set] |
Gets the character. More... | |
override object | SaveData [get] |
Gets the data to save. More... | |
override string | Identifier [get] |
Get a unique identifier to use when saving the data (for example this could be used for part of the file name or player prefs name). More... | |
![]() | |
virtual string | PlayerPrefsIdentifier [get] |
The player preference identifier. More... | |
virtual bool | EnablePersistence [get] |
Gets the value for persistence type taking in to account defaults. More... | |
virtual PersistenceResetType | PersistenceType [get] |
Gets the value for persistence type taking in to account defaults. More... | |
virtual bool | SaveOnChange [get] |
Gets the value for save on change type taking in to account defaults. More... | |
abstract Character | Character [get, set] |
Gets the character. More... | |
abstract object | SaveData [get] |
Gets the data to save. More... | |
abstract string | Identifier [get] |
Get a unique identifier to use when saving the data (for example this could be used for part of the file name or player prefs name). More... | |
![]() | |
virtual string | Header [get] |
Gets the header string used to describe the component. More... | |
virtual string | DocLink [get] |
Gets a link to documentation site. More... | |
virtual string | VideoLink [get] |
Gets a link to a youtube video. More... | |
virtual string | Deprecated [get] |
If non-null this component is deprecated. The string shows a message indicating how it should be replaced. More... | |
![]() | |
Character | Character [get, set] |
Get the character. More... | |
Events | |
System.EventHandler< SceneEventArgs > | SceneLoaded |
Event for scene load. More... | |
System.EventHandler< RespawnEventArgs > | Respawned |
Event for character respawn. More... | |
System.EventHandler< LevelEventArgs > | LevelComplete |
Event for level completed. More... | |
System.EventHandler< SceneEventArgs > | WillExitScene |
Sent when we will exit a scene. More... | |
![]() | |
System.EventHandler< EmptyEventArgs > | Loaded |
Sent when this persistable is loaded. More... | |
Additional Inherited Members | |
![]() | |
static void | Save (Persistable p) |
Save the given persistable. More... | |
static void | SaveXml (Persistable p) |
Save the given persistable in XML format. More... | |
static void | SaveBinary (Persistable p) |
Save the given persistable in XML format. More... | |
static void | Load (Persistable p) |
Load the given persistable. More... | |
static void | Reset (Persistable p) |
Resets the given persistable. More... | |
Manages respawning and respawn points.
|
virtual |
Enables and actiavtes the respawn point.
respawnPoint | Respawn point. |
|
virtual |
Applies the save data to the object.
Implements PlatformerPro.Persistable.
|
virtual |
Clear all respawn points (but dont reset level locks).
|
staticprotected |
Creates the level manager.
|
protectedvirtual |
Do the destroy actions.
|
virtual |
Enables a spawn point but doesn't set it as active.
void PlatformerPro.LevelManager.Exit | ( | ) |
Exit the scene.
|
protectedvirtual |
Handles the character loaded event by setting the character.
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
Check if the given level (or other object) is unlocked.
|
virtual |
Indicates level is complete.
|
virtual |
Load the given scene.
|
virtual |
Unlocks the given level (or object).
|
protectedvirtual |
Raises the level complete event.
levelName | Name of complete level. |
|
protectedvirtual |
Raises the respawned event.
respawnPoint | Respawn point. |
|
protectedvirtual |
Raises the scene loaded event on Start.
|
protectedvirtual |
Raises the level complete event.
newLevelName | Respawn point. |
|
virtual |
|
virtual |
Resets the save data back to default.
Implements PlatformerPro.Persistable.
|
virtual |
Respawn the specified character at the currently active reswpawn point.
character | Character. |
|
virtual |
Respawn the specified character at the specified respawn point.
character | Character. |
respawnPoint | Respawn point. |
|
virtual |
Get the type of object this Persistable saves.
Implements PlatformerPro.Persistable.
|
virtual |
Unlocks the given level (or object).
|
virtual |
Unlocks the given level (or object) and Sets a complete rating (i.e. snumber of stars, percentage, etc).
|
protected |
The currently active respawn point identifier.
|
protected |
Character to use for persistence events. Generally this is for resetting locks on game over.
bool PlatformerPro.LevelManager.clearRespawnsOnComplete = true |
Should we clear all respawn points for this level on level complete?
|
protected |
List of all enabled respawn points.
string PlatformerPro.LevelManager.exitMenuScene |
Scene to load when user exits level select.
|
staticprotected |
The instance.
|
protected |
Stores the SceneManager name of the last entered scene.
|
protected |
The level lock data.
string PlatformerPro.LevelManager.levelName |
Name of the current level
|
static |
Const key to append in front of level lock string.
bool PlatformerPro.LevelManager.saveSceneName = false |
Should we save the name of the sceen to the saved scene data?
|
staticprotected |
Have we called the scene loaded event for this scene? Used to ensure we only call scene loaded once when the first character is loaded.
string PlatformerPro.LevelManager.sceneToLoadOnLevelComplete |
Should we automatically load another scene on level complete. Leave blank if there is a level complete screen which will do the loading.
bool PlatformerPro.LevelManager.unlockLevelOnComplete = true |
Unlock the level name automatically when level completes.
|
get |
Return the active resapwn point
|
getset |
Gets the character.
|
get |
Get a copy of the list of enabled respawn points.
|
get |
Get a unique identifier to use when saving the data (for example this could be used for part of the file name or player prefs name).
|
staticgetprotected set |
Gets a reference to this object.
|
get |
Has a respawn point been set?
|
get |
The player preference identifier.
|
staticgetset |
Keeps track of the previous level.
|
get |
Gets the data to save.
System.EventHandler<LevelEventArgs> PlatformerPro.LevelManager.LevelComplete |
Event for level completed.
System.EventHandler<RespawnEventArgs> PlatformerPro.LevelManager.Respawned |
Event for character respawn.
System.EventHandler<SceneEventArgs> PlatformerPro.LevelManager.SceneLoaded |
Event for scene load.
System.EventHandler<SceneEventArgs> PlatformerPro.LevelManager.WillExitScene |
Sent when we will exit a scene.