Loading...
Searching...
No Matches
PixelCrushers.Wrappers.SaveSystem Class Reference

This wrapper for PixelCrushers.SaveSystem keeps references intact if you switch between the compiled assembly and source code versions of the original class. More...

Inheritance diagram for PixelCrushers.Wrappers.SaveSystem:
Collaboration diagram for PixelCrushers.Wrappers.SaveSystem:

Additional Inherited Members

- Public Member Functions inherited from PixelCrushers.SaveSystem
delegate string ValidateSceneNameDelegate (string sceneName, SceneValidationMode sceneValidationMode)
 
delegate void SceneLoadedDelegate (string sceneName, int sceneIndex)
 
void OnLevelWasLoaded (int level)
 
void SaveGameToSlot (int slotNumber)
 Saves a game into a slot using the storage provider on the Save System GameObject.
 
void LoadGameFromSlot (int slotNumber)
 Loads a game from a slot using the storage provider on the Save System GameObject.
 
void LoadSceneAtSpawnpoint (string sceneNameAndSpawnpoint)
 Loads a scene, optionally positioning the player at a specified spawnpoint.
 
- Static Public Member Functions inherited from PixelCrushers.SaveSystem
static string GetCurrentSceneName ()
 
static int GetCurrentSceneIndex ()
 
static IEnumerator LoadAdditiveSceneInternal (string sceneName)
 
static void UnloadAdditiveSceneInternal (string sceneName)
 
static bool HasSavedGameInSlot (int slotNumber)
 Returns true if there is a saved game in the specified slot.
 
static void DeleteSavedGameInSlot (int slotNumber)
 Deletes the saved game in the specified slot.
 
static void SaveToSlot (int slotNumber)
 Saves the current game to a slot.
 
static void SaveToSlotImmediate (int slotNumber)
 Saves the current game to a slot synchronously and immediately.
 
static void LoadFromSlot (int slotNumber)
 Loads a game from a slot.
 
static void RegisterSaver (Saver saver)
 
static void UnregisterSaver (Saver saver)
 
static void ClearSavedGameData ()
 Clears the SaveSystem's internal saved game data cache.
 
static SavedGameData RecordSavedGameData ()
 Records the current scene's savers' data into the SaveSystem's internal saved game data cache.
 
static void UpdateSaveData (Saver saver, string data)
 Updates the SaveSystem's internal saved game data cache with data for a specific saver.
 
static void ApplySavedGameData (SavedGameData savedGameData)
 Applies the saved game data to the savers in the current scene.
 
static void ApplySavedGameData ()
 Applies the most recently recorded saved game data.
 
static void BeforeSceneChange ()
 If changing scenes manually, calls before changing scenes to inform components that listen for OnDestroy messages that they're being destroyed because of the scene change.
 
static void LoadGame (SavedGameData savedGameData)
 Loads the scene recorded in the saved game data (if saveCurrentScene is true) and applies the saved game data to it.
 
static void LoadScene (string sceneNameAndSpawnpoint)
 Loads a scene, optionally moving the player to a specified spawnpoint.
 
static void LoadAdditiveScene (string sceneName)
 Additively loads another scene.
 
static void UnloadAdditiveScene (string sceneName)
 Unloads a previously additively-loaded scene.
 
static void UnloadAllAdditiveScenes ()
 Unloads all previously additively-loaded scenes.
 
static void RestartGame (string startingSceneName)
 Clears the SaveSystem's saved game data cache and loads a starting scene.
 
static void ResetGameState ()
 Clears the SaveSystem's saved game data cache.
 
static void SaversRestartGame ()
 Calls OnRestartGame on all savers.
 
static string Serialize (object data)
 Returns a serialized version of an object using whatever serializer is assigned to the SaveSystem (JSON by default).
 
static T Deserialize< T > (string s, T data=default(T))
 Deserializes a previously-serialized string representation of an object back into an object.
 
- Static Public Attributes inherited from PixelCrushers.SaveSystem
const int NoSceneIndex = -1
 
const string LastSavedGameSlotPlayerPrefsKey = "savedgame_lastSlotNum"
 Stores an int indicating the slot number of the most recently saved game.
 
static ValidateSceneNameDelegate validateNameScene = null
 Invoked before loading a scene by name.
 
- Static Protected Member Functions inherited from PixelCrushers.SaveSystem
static IEnumerator DelayedSaveDataAppliedCoroutine (int frames)
 
- Properties inherited from PixelCrushers.SaveSystem
static int version [get, set]
 Optional saved game version number of your choosing.
 
static bool saveCurrentScene [get, set]
 When loading a game, load the scene that the game was saved in.
 
static int maxSaveSlot [get, set]
 Highest save slot number allowed.
 
static int framesToWaitBeforeApplyData [get, set]
 When loading a game/scene, wait this many frames before applying saved data to allow other scripts to initialize first.
 
static int framesToWaitBeforeSaveDataAppliedEvent [get, set]
 If a saver requires additional frames after ApplyData() before the saveDataApplied() event should be called, set this property.
 
static bool debug [get, set]
 
static bool hasInstance [get]
 Checks if an instance already exists, without also implicitly creating one.
 
static SaveSystem instance [get]
 
static DataSerializer serializer [get]
 Reference to the DataSerializer in the SaveSystem's hierarchy.
 
static SavedGameDataStorer storer [get]
 Reference to the SavedGameDataStorer in the SaveSystem's hierarchy.
 
static SceneTransitionManager sceneTransitionManager [get]
 Reference to the SceneTransitionManager in the SaveSystem's hierarchy, if present.
 
bool allowNegativeSlotNumbers [get, set]
 Allow the use of negative slot numbers.
 
static List< string > addedScenes [get]
 Scenes that have been loaded additively.
 
static bool autoUnloadAdditiveScenes [get, set]
 When changing scenes, automatically unload all additively-loaded scenes.
 
static AsyncOperation currentAsyncOperation [get, set]
 Current asynchronous scene load operation, or null if none.
 
static SavedGameData currentSavedGameData [get, set]
 The saved game data recorded by the last call to SaveToSlot, LoadScene, or RecordSavedGameData.
 
static GameObject playerSpawnpoint [get, set]
 Where the player should spawn in the current scene.
 
static int currentSceneIndex [get]
 Build index of the current scene.
 
- Events inherited from PixelCrushers.SaveSystem
static SceneLoadedDelegate sceneLoaded = delegate { }
 Invoked after a scene has been loaded.
 
static System.Action saveStarted = delegate { }
 Invoked when starting to save a game.
 
static System.Action saveEnded = delegate { }
 Invoked when finished saving a game.
 
static System.Action loadStarted = delegate { }
 Invoked when starting to load a game.
 
static System.Action loadEnded = delegate { }
 Invoked when finished loading a game.
 
static System.Action saveDataApplied = delegate { }
 Invoked after ApplyData() has been called on all savers.
 

Detailed Description

This wrapper for PixelCrushers.SaveSystem keeps references intact if you switch between the compiled assembly and source code versions of the original class.


The documentation for this class was generated from the following file: