SaveController
Controller which implements basic Save/Load/Delete logic for the specified slot. By slot we mean unique string value.
Save
To save the game, you should pass an instance of GameEntity to this controller and a string which represents a slot name.
Also, you could specify an Action which will be played after save process will be finished (for example disable UI save icon)
Inside the SaveGame method, GameEntity will be serialized to an array of bytes, at first. Then the received array will be written to a file inside <Application.persistentDataPath>/Saves folder.
Load
To load the game, you should pass the name of a save file.
Also, you could specify an Action which will be played after load process will be finished (for example disable UI load icon)
LoadGame operates in reverse order in comparison to SaveGame method. At first, it reads bytes from the file. Then it deserializes bytes to an instance of the GameSave class.
Delete
DeleteGame method is the simplest one. It just deletes the file with the specified name.
Created with the Personal Edition of HelpNDoc: Elevate your documentation to new heights with HelpNDoc's built-in SEO