|
|
@ -186,19 +186,18 @@ namespace Fungus |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Save the current game state to persistant storage. |
|
|
|
* Save the current game variables to persistant storage. |
|
|
|
* Only the values, string table and current scene are stored. |
|
|
|
* Store the currently loaded scene name so that Game.LoadGame() can automatically move to the appropriate scene. |
|
|
|
* @param saveName The name of the saved game data. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
[Obsolete("Use Variables.Save() instead.")] |
|
|
|
public void SaveGame() |
|
|
|
public void SaveGame(string saveName) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
SetString("_scene", Application.loadedLevelName); |
|
|
|
Variables.Save(); |
|
|
|
Variables.Save(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Loads the current game state from persistant storage. |
|
|
|
* Loads the current game state from persistant storage. |
|
|
|
* This will cause the scene specified in the "Fungus.Scene" string to be loaded. |
|
|
|
* This will cause the scene specified in the "_scene" string to be loaded. |
|
|
|
* Each scene in your game should contain the necessary code to restore the current game state based on saved data. |
|
|
|
* Each scene in your game should contain the necessary code to restore the current game state based on saved data. |
|
|
|
* @param saveName The name of the saved game data. |
|
|
|
* @param saveName The name of the saved game data. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|