UnityEssentials
Small but useful tools and features for Unity
Static Public Member Functions | Static Public Attributes | Static Private Member Functions | List of all members
UnityEngine.SaveDataManager Class Reference

A class to save almost any kind of data on almost all devices (not heavily tested). More...

Collaboration diagram for UnityEngine.SaveDataManager:
Collaboration graph

Static Public Member Functions

static void OpenSavedDataFolder ()
 
static void Save< T > (T objectToSave, string filename, string encryptionPassword=null, Encoding encoding=null)
 Saves data using the identifier. More...
 
static T Load< T > (string filename, T defaultValue, string encryptionPassword=null, Encoding encoding=null, bool supressFileNotFoundWarning=false)
 Loads data using identifier. More...
 
static bool Exists (string filename)
 Checks whether the specified identifier exists or not. More...
 
static void Delete (string filename)
 Delete the specified identifier and path. More...
 
static void DeleteAll ()
 Deletes all. More...
 

Static Public Attributes

static string saveDataPath = Application.persistentDataPath
 

Static Private Member Functions

static string GetFilePath (string filename)
 

Detailed Description

A class to save almost any kind of data on almost all devices (not heavily tested).

Definition at line 37 of file SaveDataManager.cs.

Member Function Documentation

◆ Delete()

static void UnityEngine.SaveDataManager.Delete ( string  filename)
static

Delete the specified identifier and path.

Parameters
filenameIdentifier of the file to delete. Can route to a folder relative to the Application.persistentDataPath.

Definition at line 282 of file SaveDataManager.cs.

Here is the call graph for this function:

◆ DeleteAll()

static void UnityEngine.SaveDataManager.DeleteAll ( )
static

Deletes all.

Be aware, it will delete all files found in the '

>

Definition at line 313 of file SaveDataManager.cs.

Here is the call graph for this function:

◆ Exists()

static bool UnityEngine.SaveDataManager.Exists ( string  filename)
static

Checks whether the specified identifier exists or not.

Parameters
filenameIdentifier of the file to check. Can route to a folder relative to the Application.persistentDataPath.

Definition at line 236 of file SaveDataManager.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFilePath()

static string UnityEngine.SaveDataManager.GetFilePath ( string  filename)
staticprivate

Definition at line 272 of file SaveDataManager.cs.

Here is the caller graph for this function:

◆ Load< T >()

static T UnityEngine.SaveDataManager.Load< T > ( string  filename,
defaultValue,
string  encryptionPassword = null,
Encoding  encoding = null,
bool  supressFileNotFoundWarning = false 
)
static

Loads data using identifier.

Parameters
filenameIdentifier of the file containing the data. Can route to a folder relative to the Application.persistentDataPath.
defaultValueDefault Value. Used in case the saved data is not found.
encryptionPasswordEncryption Password (set it to the same password you used to save it).
encodingEncoding.
supressFileNotFoundWarningShould the warning be disabled so if the desired data is not found no warning is created? Set it to True for hiding the warning.
Template Parameters
TThe objectToSave's type.

Definition at line 154 of file SaveDataManager.cs.

Here is the call graph for this function:

◆ OpenSavedDataFolder()

static void UnityEngine.SaveDataManager.OpenSavedDataFolder ( )
static

Definition at line 48 of file SaveDataManager.cs.

◆ Save< T >()

static void UnityEngine.SaveDataManager.Save< T > ( objectToSave,
string  filename,
string  encryptionPassword = null,
Encoding  encoding = null 
)
static

Saves data using the identifier.

Parameters
filenameIdentifier of the file containing the data. Can route to a folder relative to the Application.persistentDataPath.
objectToSaveObject to save.
encryptionPasswordEncryption Password.
encodingEncoding.
Template Parameters
TThe objectToSave's type.

Definition at line 66 of file SaveDataManager.cs.

Here is the call graph for this function:

Member Data Documentation

◆ saveDataPath

string UnityEngine.SaveDataManager.saveDataPath = Application.persistentDataPath
static

Definition at line 39 of file SaveDataManager.cs.


The documentation for this class was generated from the following file: