Table of Contents

Class SingletonScriptableObject<T>

Namespace
CodeBase
Assembly
4Experience.CodeBase.Core.Runtime.dll

Default implementation of Singleton for ScriptableObject scripts. It uses mechanics of lazy initialization. The first time it is called, it creates its instance. Supports Singleton for editor (located in the Editor folder) and runtime scripts (located in the Resources/Settings/type_name.asset) The search is based on the name taken from type.Name.

public class SingletonScriptableObject<T> : ExtendedScriptableObject where T : ExtendedScriptableObject

Type Parameters

T
Inheritance
Object
ScriptableObject
SingletonScriptableObject<T>
Derived
Extension Methods

Fields

NONE_SCRIPTABLE_OBJECT_ERROR_MESSAGE

private const string NONE_SCRIPTABLE_OBJECT_ERROR_MESSAGE = "Please create ScriptableObject typeof {0} first."

Field Value

string

NOT_UNIQUE_SCRIPTABLE_OBJECT_WARNING_MESSAGE

private const string NOT_UNIQUE_SCRIPTABLE_OBJECT_WARNING_MESSAGE = "ScriptableObject typeof {0} exist multiple times, Singleton must exist in only one instance."

Field Value

string

instance

private static T instance

Field Value

T

Properties

Instance

public static T Instance { get; private set; }

Property Value

T

Methods

LoadInstanceForUnityEditorTools()

private static T LoadInstanceForUnityEditorTools()

Returns

T

LoadInstanceFromResources()

private static T LoadInstanceFromResources()

Returns

T