Skip to main content

EditorApiSettings

A class in Root.Township, the global namespace.

Global settings for how the editor talks to the web API: offline mode, which endpoint to use, and an optional credentials override file. Read through GlobalSettings<EditorApiSettings>.Instance.

Constructors​

MemberWhat it is
EditorApiSettings()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

8 private and internal fields
MemberWhat it is
private TextAsset credentialOverrideFileText asset holding the override credentials JSON.
private string customEndpointBacking field for CustomEndpoint.
private const string DefaultEditorOverrideCredentialsFilenameDefault file name for the override credentials, MyEditorCredentials.json.
private const string DefaultEditorOverrideCredentialsPathDefault asset folder for the override credentials file.
private ApiEndpoint endpointInEditorBacking field for EndpointInEditor.
private bool isIgnoringInternetOfflineBacking field for IsIgnoringInternetOffline.
private bool isOfflineBacking field for IsOffline.
private bool isOverridingCredentialInEditorBacking field for IsOverridingCredentialInEditor.

Properties​

MemberWhat it is
string CustomEndpoint { get; }URL used when the editor endpoint is set to custom.
ApiEndpoint EndpointInEditor { get; }Which API endpoint the editor uses.
bool IsIgnoringInternetOffline { get; }Whether the editor ignores the internet being offline.
bool IsOffline { get; }Whether the editor runs without the API.
static bool IsOverridingCredentialInEditor { get; }True only in the editor when the override credentials option is on.

Methods​

MemberWhat it is
static EditorOverrideCredentials GetOverrideCredentials()Parses the override credentials JSON file, throwing if there is none.
1 private and internal method
MemberWhat it is
private static void CreateDefaultCredentialOverrideFile()Empty in this build, so GetOverrideCredentials throws when no file is set.