ES3.LoadInto

public static void LoadInto<T>(string key, T obj, string filePath, ES3Settings settings)

Description

Loads the value from a file with the given key into an existing object, rather than creating a new instance.

KeyNotFoundException or FileNotFoundException will be thrown if the data does not exist. You can use ES3.KeyExists or ES3.FileExists to check if the data exists before loading.

Parameters

T The type of the data we wish to load. Can be an inherited type.

key

The unique key which identifies the data we're loading.

obj

The object of type T we want to load the data into.

filePath

[Optional] The relative or absolute path of the file we want to load from.

settings

[Optional] The settings we want to use to override the default settings.

Returns

The loaded data of type T, or the default value if using the defaultValue parameter and there is no data to load.

Examples

C#

JS