Class SceneFile
An object that allows managing the properties of a saved
Inherited Members
Namespace: SaveIsEasy
Assembly: SaveIsEasyDLL.dll
Syntax
public class SceneFile
Properties
Copy
To get the copy file
Declaration
public SceneFileCopy Copy { get; }
Property Value
Type | Description |
---|---|
SceneFileCopy | This will return null if the copy file not exists |
ErrorMessage
This is to get the error message that has been produced in the load of the object.
Declaration
public string ErrorMessage { get; }
Property Value
Type | Description |
---|---|
System.String | Empty string for not error, Or the error message. |
FormatVersion
Gets the build version of the asset
Declaration
public int FormatVersion { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
HasSaveIsEasyStatistics
If the game was saved with a SaveIsEasyStatistics enable.
Declaration
public bool HasSaveIsEasyStatistics { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
LastModifiedDate
Returns the date and time, in coordinated universal time (UTC), of the last saved.
Declaration
public DateTime LastModifiedDate { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
Name
Returns the file name of save without the extension.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String | This only returns the name of the file, example: 'level1' |
QuickAccess
All the quick access values that were loaded from the file. key(string) the name of the field -> object
Declaration
public Dictionary<string, object> QuickAccess { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Object> |
SceneBuildIndex
The BuildIndex of the scene that was loaded when the game was saved.
Declaration
public int SceneBuildIndex { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
SceneName
The Name of the scene that was loaded when the game was saved.
Declaration
public string SceneName { get; }
Property Value
Type | Description |
---|---|
System.String |
ScenePath
The Path of the scene that was loaded when the game was saved.
Declaration
public string ScenePath { get; }
Property Value
Type | Description |
---|---|
System.String |
StatisticsCreationDate
The time in which the game was created, in UTC format.
Declaration
public long StatisticsCreationDate { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
StatisticsCreationDateAsDateTime
The time in which the game was created.
Declaration
public DateTime StatisticsCreationDateAsDateTime { get; }
Property Value
Type | Description |
---|---|
System.DateTime |
StatisticsLoads
The amount of times the game was load.
Declaration
public ushort StatisticsLoads { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
StatisticsScreenshotAsSprite
To get the screenshot when the game was saved.
Declaration
public Sprite StatisticsScreenshotAsSprite { get; }
Property Value
Type | Description |
---|---|
Sprite |
StatisticsScreenshotAsTexture2D
To get the screenshot when the game was saved.
Declaration
public Texture2D StatisticsScreenshotAsTexture2D { get; }
Property Value
Type | Description |
---|---|
Texture2D |
StatisticsTotalTimeInSeconds
The time he spent playing at this save, in seconds.
Declaration
public uint StatisticsTotalTimeInSeconds { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
StatisticsTotalTimeInSecondsAsTimeSpan
The time he spent playing at this save.
Declaration
public TimeSpan StatisticsTotalTimeInSecondsAsTimeSpan { get; }
Property Value
Type | Description |
---|---|
System.TimeSpan |
Methods
CheckIntegrity()
This will try to read all file data to verify the integrity
Declaration
public SceneFile.IntegrityResult CheckIntegrity()
Returns
Type | Description |
---|---|
SceneFile.IntegrityResult | An enum with the result of whether the file is valid or not. |
CheckIntegrity(Scene)
This will try to read all file data to verify the integrity
Declaration
public SceneFile.IntegrityResult CheckIntegrity(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 |
---|---|
SceneFile.IntegrityResult | An enum with the result of whether the file is valid or not. |
Delete()
Delete this save file and if have a copy that too.
Declaration
public virtual void Delete()
Duplicate(String)
To create a copy of this save file
Declaration
public virtual SceneFile Duplicate(string newName)
Parameters
Type | Name | Description |
---|---|---|
System.String | newName | The new name, Supports absolute and relative formats examples: 'level2', 'test/level3', 'C:/Test/level4' |
Returns
Type | Description |
---|---|
SceneFile | The new file that was created |
GetAccessObjectAsType<T>(String)
Get a value that was saved with QuickAccessAttribute.
Declaration
public T GetAccessObjectAsType<T>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field that was saved, Case sensitive. |
Returns
Type | Description |
---|---|
T | The value, if it is not found, the function returns default(T). |
Type Parameters
Name | Description |
---|---|
T |
GetQuickAccessBoolean(String)
Get a value that was saved with QuickAccessAttribute.
Declaration
public bool GetQuickAccessBoolean(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field that was saved. |
Returns
Type | Description |
---|---|
System.Boolean | The value, if it is not found, the function returns false. |
GetQuickAccessDouble(String)
Get a value that was saved with QuickAccessAttribute.
Declaration
public double GetQuickAccessDouble(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field that was saved. |
Returns
Type | Description |
---|---|
System.Double | The value, if it is not found, the function returns 0. |
GetQuickAccessInt32(String)
Get a value that was saved with QuickAccessAttribute.
Declaration
public int GetQuickAccessInt32(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field that was saved. |
Returns
Type | Description |
---|---|
System.Int32 | The value, if it is not found, the function returns 0. |
GetQuickAccessInt64(String)
Get a value that was saved with QuickAccessAttribute.
Declaration
public long GetQuickAccessInt64(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field that was saved. |
Returns
Type | Description |
---|---|
System.Int64 | The value, if it is not found, the function returns 0. |
GetQuickAccessObject(String)
Get a value that was saved with QuickAccessAttribute.
Declaration
public object GetQuickAccessObject(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field that was saved. |
Returns
Type | Description |
---|---|
System.Object | The value, if it is not found, the function returns null. |
GetQuickAccessSingle(String)
Get a value that was saved with QuickAccessAttribute.
Declaration
public float GetQuickAccessSingle(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field that was saved. |
Returns
Type | Description |
---|---|
System.Single | The value, if it is not found, the function returns 0. |
GetQuickAccessString(String)
Get a value that was saved with QuickAccessAttribute.
Declaration
public string GetQuickAccessString(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field that was saved. |
Returns
Type | Description |
---|---|
System.String | The value, if it is not found, the function returns "". |
HasKeyQuickAccess(String)
To know if there is a field in quick access.
Declaration
public bool HasKeyQuickAccess(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the field that was saved. |
Returns
Type | Description |
---|---|
System.Boolean | True = the field exists, False = the field does not exist. |
HaveCopy()
This file has a copy or is a copy?
Declaration
public virtual bool HaveCopy()
Returns
Type | Description |
---|---|
System.Boolean | True = has a copy, False = not has a copy |
IsCopy()
Is this object a copy of a saved file?
Declaration
public virtual bool IsCopy()
Returns
Type | Description |
---|---|
System.Boolean | False = it is not a copy, True = It is a copy file |
IsEncrypted()
If this file encrypted?
Declaration
public bool IsEncrypted()
Returns
Type | Description |
---|---|
System.Boolean | True = it is encrypted, False = it is not encrypted |
LoadSceneAndGame()
Load the corresponding scene and then load the game.
Declaration
public void LoadSceneAndGame()
LoadSceneAndGame(SceneFile.LoadSceneBy, Boolean, Boolean)
Load the corresponding scene and then load the game.
Declaration
public void LoadSceneAndGame(SceneFile.LoadSceneBy loadSceneBy, bool eraseInvalidsGameObject, bool runInThread)
Parameters
Type | Name | Description |
---|---|---|
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(SceneFile.LoadSceneBy, Boolean, Boolean, LoadSceneMode)
Load the corresponding scene and then load the game.
Declaration
public void LoadSceneAndGame(SceneFile.LoadSceneBy loadSceneBy, bool eraseInvalidsGameObject, bool runInThread, LoadSceneMode mode)
Parameters
Type | Name | Description |
---|---|---|
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. |
Rename(String)
To rename this file name and if have a copy that too
Declaration
public virtual void Rename(string newName)
Parameters
Type | Name | Description |
---|---|---|
System.String | newName |