SaveGame.Load
Description
Load the data from the specified identifier.
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| identifier | string | The identifier to load the data from. | required |
| defaultValue | T | The default value to return if the value does not exists | optional |
| encode | bool | Use Encryption? | optional |
| password | string | The encryption password | optional |
| serializer | ISaveGameSerializer | The serializer | optional |
| encoder | ISaveGameEncoder | The encoder | optional |
| encoding | Encoding | The Unicode encoding | optional |
| path | SaveGamePath | The path to load data from | optional |
Returns
The loaded data if exists, otherwise returns the default value specified, else returns null.
Examples
Loading Simple Data
// Loading by Generic
string simple = SaveGame.Load<string> ( "simple.txt", "The Default Value" );
// Loading by Type
string simple = ( string )SaveGame.Load ( "simple.txt", typeof ( string ), "The Default Value" );
Loading Array
// Loading by Generic
string[] names = SaveGame.Load<string[]> ( "names.txt" );
// Loading by Type
string[] names = ( string[] )SaveGame.Load ( "names.txt", typeof ( string[] ) );