Class SaveIsEasyAPI
This is the main asset class, with this class you can Save/Load the game, along with a variety of options.
Inheritance
Inherited Members
Namespace: SaveIsEasy
Assembly: SaveIsEasyDLL.dll
Syntax
public static class SaveIsEasyAPI
Properties
EncryptionConfig
Returns the current configuration of the encryption system.
Declaration
public static SceneConfig.EncryptionConfig EncryptionConfig { get; }
Property Value
Type | Description |
---|---|
SceneConfig.EncryptionConfig |
IsLoaded
To see if the level is loaded
Declaration
public static bool IsLoaded { get; }
Property Value
Type | Description |
---|---|
System.Boolean | If the level is loaded |
IsSaved
To see if the level is saved
Declaration
public static bool IsSaved { get; }
Property Value
Type | Description |
---|---|
System.Boolean | If the level is saved |
IsSaveIsEasyManagerValid
In the scene is there a 'SaveIsEasyManager' and is it enabled?
Declaration
public static bool IsSaveIsEasyManagerValid { get; }
Property Value
Type | Description |
---|---|
System.Boolean | True is valid and enabled, False it is not valid |
MinimumVersionSupportedOfUnity
The minimum supported version of unity for the asset to work correctly. In the Asset Store you can download a distribution for older versions of unity.
Declaration
public static string MinimumVersionSupportedOfUnity { get; }
Property Value
Type | Description |
---|---|
System.String |
SaveFolderPath
To get the default save folder path
Declaration
public static string SaveFolderPath { get; }
Property Value
Type | Description |
---|---|
System.String | The default save folder path |
SaveIsEasyManager
Get the actual SaveIsEasyManager
Declaration
public static SaveIsEasyManager SaveIsEasyManager { get; }
Property Value
Type | Description |
---|---|
SaveIsEasyManager | SaveIsEasyComponent or null |
SceneConfig
Get the object in charge of managing the configuration for the level
Declaration
public static SceneConfig SceneConfig { get; }
Property Value
Type | Description |
---|---|
SceneConfig |
SceneFileName
The name of the file to save, On set: Only numbers and letters, example: 'level1' and cannot be empty On get: The filename only, example: 'level1', On error return null
Declaration
public static string SceneFileName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
FileExists(String)
To see if the game file already exists. If the route is relative, it is verified from Folder Path. SaveFolderPath
Declaration
public static bool FileExists(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | Only allows '.game' of '.gamecopy' extensions, Supports absolute and relative formats examples: 'level1.game', 'level2', 'test/level3', 'C:/Test/level4', 'C:/Test/level5.game' |
Returns
Type | Description |
---|---|
System.Boolean | Status if the file exists |
GetEncryptionConfigByScene(Scene)
Returns the current configuration of the encryption system in the specified scene.
Declaration
public static SceneConfig.EncryptionConfig GetEncryptionConfigByScene(Scene scene)
Parameters
Type | Name | Description |
---|---|---|
Scene | scene | In the scene where it is going to do the requested, it requires that a 'SaveIsEasyManager' is valid and active in that scene. |
Returns
Type | Description |
---|---|
SceneConfig.EncryptionConfig | The encryption configuration. |
GetSaveIsEasyManagerByScene(Scene)
Is going to look for the 'SaveIsEasyManager' in charge of managing the scene, the scene has to be loaded.
Declaration
public static SaveIsEasyManager GetSaveIsEasyManagerByScene(Scene scene)
Parameters
Type | Name | Description |
---|---|---|
Scene | scene | In the scene where it is going to do the requested, it requires that a 'SaveIsEasyManager' is valid and active in that scene. |
Returns
Type | Description |
---|---|
SaveIsEasyManager | The corresponding manager of the scene or null if there is no valid one. |
GetSceneConfigByScene(Scene)
Get the object in charge of managing the configuration for the level in the specified scene
Declaration
public static SceneConfig GetSceneConfigByScene(Scene scene)
Parameters
Type | Name | Description |
---|---|---|
Scene | scene | In the scene where it is going to do the requested, it requires that a 'SaveIsEasyManager' is valid and active in that scene. |
Returns
Type | Description |
---|---|
SceneConfig | The object that is in charge of managing the configuration for the level |
GetSceneFile(String)
This will return if the file exists and is valid in the Folder Path
Declaration
public static SceneFile GetSceneFile(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The filename, Supports absolute and relative formats examples: 'level1.game', 'level2', 'test/level3', 'C:/Test/level4', 'C:/Test/level5.game' |
Returns
Type | Description |
---|---|
SceneFile | SceneFile or null |
GetSceneFileNameByScene(Scene)
To get the name of the file to save in the specified scene
Declaration
public static string GetSceneFileNameByScene(Scene scene)
Parameters
Type | Name | Description |
---|---|---|
Scene | scene | In the scene where it is going to do the requested, it requires that a 'SaveIsEasyManager' is valid and active in that scene. |
Returns
Type | Description |
---|---|
System.String | The filename as absolute path or relative, examples: 'level1', 'test/level3', 'C:/Test/level4', On error return null |
IsSaveIsEasyManagerValidByScene(Scene)
In the scene is there a 'SaveIsEasyManager' and is it enabled and active?
Declaration
public static bool IsSaveIsEasyManagerValidByScene(Scene scene)
Parameters
Type | Name | Description |
---|---|---|
Scene | scene | In the scene where it is going to check. |
Returns
Type | Description |
---|---|
System.Boolean | True is valid and enabled, False it is not valid |
ListOfValidSaves()
This will list all the valid files in the Folder Path
Declaration
public static ReadOnlyCollection<SceneFile> ListOfValidSaves()
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<SceneFile> | A list of all the valid files in the folder |
ListOfValidSaves(String)
This will list all the valid files in the Folder Path
Declaration
public static ReadOnlyCollection<SceneFile> ListOfValidSaves(string folderPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | folderPath | The absolute or relative path to the Folder |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<SceneFile> | A list of all the valid files in the folder |
LoadAll()
To load the game, with the actual SceneFileName, not running in thread, and erasing invalids gameObjects
Declaration
public static void LoadAll()
LoadAll(Scene)
To load the game in the specified scene.
Declaration
public static void LoadAll(Scene scene)
Parameters
Type | Name | Description |
---|---|---|
Scene | scene | In the scene where it is going to do the requested, it requires that a 'SaveIsEasyManager' is valid and active in that scene. |
LoadAll(Boolean, Boolean)
To load the game, with the actual SceneFileName
Declaration
public static void LoadAll(bool eraseInvalidsGameObject, bool runInThread)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | eraseInvalidsGameObject | To erase old or invalids GameObjects with SaveIsEasyComponent, recommended true |
System.Boolean | runInThread | This needs to run in a thread?, recommended true |
LoadAll(Boolean, Boolean, Scene)
To load the game in the specified scene, with the actual SceneFileName.
Declaration
public static void LoadAll(bool eraseInvalidsGameObject, bool runInThread, Scene scene)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | eraseInvalidsGameObject | To erase old or invalids GameObjects with SaveIsEasyComponent, recommended true |
System.Boolean | runInThread | This needs to run in a thread?, recommended true |
Scene | scene | In the scene where it is going to do the requested, it requires that a 'SaveIsEasyManager' is valid and active in that scene. |
LoadAll(String)
To load the game.
Declaration
public static void LoadAll(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file name, Supports absolute and relative formats examples: 'level1.game', 'level2', 'test/level3', 'C:/Test/level4', 'C:/Test/level5.game' |
LoadAll(String, Scene)
To load the game in the specified scene.
Declaration
public static void LoadAll(string fileName, Scene scene)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file name, Supports absolute and relative formats examples: 'level1.game', 'level2', 'test/level3', 'C:/Test/level4', 'C:/Test/level5.game' |
Scene | scene | In the scene where it is going to do the requested, it requires that a 'SaveIsEasyManager' is valid and active in that scene. |
LoadAll(String, Boolean, Boolean)
To load the game
Declaration
public static void LoadAll(string fileName, bool eraseInvalidsGameObject, bool runInThread)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file name, Supports absolute and relative formats examples: 'level1.game', 'level2', 'test/level3', 'C:/Test/level4', 'C:/Test/level5.game' |
System.Boolean | eraseInvalidsGameObject | To erase old or invalids GameObjects with SaveIsEasyComponent, recommended true |
System.Boolean | runInThread | This needs to run in a thread?, recommended true |
LoadAll(String, Boolean, Boolean, Scene)
To load the game in the specified scene.
Declaration
public static void LoadAll(string fileName, bool eraseInvalidsGameObject, bool runInThread, Scene scene)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file name, Supports absolute and relative formats examples: 'level1.game', 'level2', 'test/level3', 'C:/Test/level4', 'C:/Test/level5.game' |
System.Boolean | eraseInvalidsGameObject | To erase old or invalids GameObjects with SaveIsEasyComponent, recommended true |
System.Boolean | runInThread | This needs to run in a thread?, recommended true |
Scene | scene | In the scene where it is going to do the requested, it requires that a 'SaveIsEasyManager' is valid and active in that scene. |
LoadSceneAndGame()
Load the corresponding scene of SaveIsEasyAPI.SceneFileName and then load the game.
Declaration
public static void LoadSceneAndGame()
LoadSceneAndGame(String)
Load the corresponding scene and then load the game.
Declaration
public static void LoadSceneAndGame(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file name, Supports absolute and relative formats examples: 'level1.game', 'level2', 'test/level3', 'C:/Test/level4', 'C:/Test/level5.game' |
LoadSceneAndGame(String, SceneFile.LoadSceneBy, Boolean, Boolean)
Load the corresponding scene and then load the game.
Declaration
public static void LoadSceneAndGame(string fileName, SceneFile.LoadSceneBy loadSceneBy, bool eraseInvalidsGameObject, bool runInThread)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file name, Supports absolute and relative formats examples: 'level1.game', 'level2', 'test/level3', 'C:/Test/level4', 'C:/Test/level5.game' |
SceneFile.LoadSceneBy | loadSceneBy | How to look for the scene |
System.Boolean | eraseInvalidsGameObject | To erase old or invalids GameObjects with SaveIsEasyComponent, recommended true |
System.Boolean | runInThread | This needs to run in a thread?, recommended true |
LoadSceneAndGame(String, SceneFile.LoadSceneBy, Boolean, Boolean, LoadSceneMode)
Load the corresponding scene and then load the game.
Declaration
public static void LoadSceneAndGame(string fileName, SceneFile.LoadSceneBy loadSceneBy, bool eraseInvalidsGameObject, bool runInThread, LoadSceneMode mode)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file name, Supports absolute and relative formats examples: 'level1.game', 'level2', 'test/level3', 'C:/Test/level4', 'C:/Test/level5.game' |
SceneFile.LoadSceneBy | loadSceneBy | How to look for the scene |
System.Boolean | eraseInvalidsGameObject | To erase old or invalids GameObjects with SaveIsEasyComponent, recommended true |
System.Boolean | runInThread | This needs to run in a thread?, recommended true |
LoadSceneMode | mode | In the mode that is going to load the scene. |
SaveAll()
To save the game, with the actual SceneFileName
Declaration
public static void SaveAll()
SaveAll(Scene)
To save the game, with the actual SceneFileName in the specified scene.
Declaration
public static void SaveAll(Scene scene)
Parameters
Type | Name | Description |
---|---|---|
Scene | scene | In the scene where it is going to do the requested, it requires that a 'SaveIsEasyManager' is valid and active in that scene. |
SaveAll(Boolean)
To save the game, with the actual SceneFileName
Declaration
public static void SaveAll(bool runInThread)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | runInThread | This needs to run in a thread?, recommended true |
SaveAll(Boolean, Scene)
To save the game, with the actual SceneFileName in the specified scene.
Declaration
public static void SaveAll(bool runInThread, Scene scene)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | runInThread | This needs to run in a thread?, recommended true |
Scene | scene | In the scene where it is going to do the requested, it requires that a 'SaveIsEasyManager' is valid and active in that scene. |
SaveAll(String)
To save the game
Declaration
public static void SaveAll(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file name, Supports absolute and relative formats examples: 'level1.game', 'level2', 'test/level3', 'C:/Test/level4', 'C:/Test/level5.game' |
SaveAll(String, Scene)
To save the game in the specified scene.
Declaration
public static void SaveAll(string fileName, Scene scene)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file name, Supports absolute and relative formats examples: 'level1.game', 'level2', 'test/level3', 'C:/Test/level4', 'C:/Test/level5.game' |
Scene | scene | In the scene where it is going to do the requested, it requires that a 'SaveIsEasyManager' is valid and active in that scene. |
SaveAll(String, Boolean)
To save the game
Declaration
public static void SaveAll(string fileName, bool runInThread)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file name, Supports absolute and relative formats examples: 'level1.game', 'level2', 'test/level3', 'C:/Test/level4', 'C:/Test/level5.game' |
System.Boolean | runInThread | This needs to run in a thread?, recommended true. |
SaveAll(String, Boolean, Scene)
To save the game in the specified scene.
Declaration
public static void SaveAll(string fileName, bool runInThread, Scene scene)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file name, Supports absolute and relative formats examples: 'level1.game', 'level2', 'test/level3', 'C:/Test/level4', 'C:/Test/level5.game' |
System.Boolean | runInThread | This needs to run in a thread?, recommended true. |
Scene | scene | In the scene where it is going to do the requested, it requires that a 'SaveIsEasyManager' is valid and active in that scene. |
SetSaveFolderPath(String)
To set the default save folder path
Declaration
public static void SetSaveFolderPath(string folderPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | folderPath | An absolute path of a folder, Example: 'C:/Test/', 'C:/Test/Levels/' |
SetSceneFileNameByScene(String, Scene)
To set the name of the file to save in the specified scene
Declaration
public static void SetSceneFileNameByScene(string value, Scene scene)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The file, Supports absolute and relative formats, examples: 'level1.game', 'level2', 'test/level3', 'C:/Test/level4', 'C:/Test/level5.game' |
Scene | scene | In the scene where it is going to do the requested, it requires that a 'SaveIsEasyManager' is valid and active in that scene. |