Save Manager Scripting Reference



All code for this asset is under the following namespace(s):

// General Code

To access code from the asset you will need to be using the asset namespace in your script or use the full path of the asset script in order to access it.



All methods in class are static and can be accessed by using class name before the method without needing a reference to an instance of the script.

// Example of usage... replacing "MyMethodHere" with the method you want to call.
Save Manager



Saves the data provided into the method into the save file.

Example Usage

SaveManager.SaveGame(SaveData data); 

Loads the game data from the file or returns a warning if not data was found.

SaveData – SaveData containing and save data that was in the save file.

Example Usage

var data = SaveManager.LoadGame();

Checks to see if a save file exists and returns it for use.

Example Usage

if (SaveManager.HasSaveFile())

Resets the save file to the default values.

Example Usage


Deletes the current save file.

Example Usage



Saving and loading your game is somewhat subjective as each game requires a different setup. However, most games will want to load their data on the start of the game, edit it when levels are complete and save it when progress is made. We recommend having a static or persistent object that holds a copy of the save data class as a variable which can be edited on the fly and using in the saving and loading process. Below are some examples of how to go about each stage. These can also be seen in the example script in the asset which is used in the example scene of the asset.


Here we’re assuming that you have an empty GameObject or similar which holds this script to load the game when the scene starts. This is one of the better ways of loading the game if you need the data in each scene.

// Gets the game save from the file....
SaveData loadData = SaveManager.LoadGame();

// Applies the values to the = loadData.playerName; = loadData.playerHealth.ToString();
player.trandform.position = loadData.playerPosition.ToString();
player.sprite = loadData.playerSprite;


Saving can be done whenever, however it is recommended that you only save when necessary to avoid an impact to your games performance.

// Makes a new save data class instance for use...
SaveData saveData = new SaveData();

// Applies the values to the class for saving...
saveData.playerName =;
saveData.playerHealth =;
saveData.playerPosition = player.transform.position;
saveData.playerSprite = player.sprite;

// Saves the game with the class creates/edited above...