Class EditorGameServiceRemoteConfiguration<T>
Fetches and parses JSON config object or returns a newly constructed object on failure. If the config is successfully loaded it will be cached in SessionState
Namespace: Unity.Services.Core.Editor
Syntax
public class EditorGameServiceRemoteConfiguration<T> : object where T : new()
Type Parameters
Name | Description |
---|---|
T | The type of object to deserialize |
Constructors
EditorGameServiceRemoteConfiguration(String)
Constructor
Declaration
public EditorGameServiceRemoteConfiguration(string configUrl)
Parameters
Type | Name | Description |
---|---|---|
String | configUrl | The url to use to fetch the config |
Methods
ClearCache()
Erases the configuration from SessionState and from memory. Will force the configuration to be fetched from the server the next time it is requested.
Declaration
public void ClearCache()
GetConfiguration(Action<T>)
Retrieves the configuration from the cache or server and provides it to the caller. Makes an effort to return the cached object first, then checks SessionState, and finally fetches from the server. If all else fails returns a default constructed object. NB: Newly constructed instances of this class will use SessionState if it's available before calling out to the server.
Declaration
public void GetConfiguration(Action<T> onGetConfigurationCompleted)
Parameters
Type | Name | Description |
---|---|---|
Action<T> | onGetConfigurationCompleted | Callback action to retrieve the configuration. |