ES3File.Load

public T Load<T>(string key, T defaultValue)

Description

Loads the value from an ES3File with the given key.

Unless you specify the defaultValue parameter, a KeyNotFoundException will be thrown if the data does not exist. In this case, you can use ES3File.KeyExists to check if the key 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.

defaultValue

[Optional] The value we want to return if the key does not exist.

Returns

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

Examples

C#

JS