![]() |
Infohazard.Core 1.4.1
Infohazard Core Utility Library
|
Base class that makes it easier to write ScriptableObjects that always have exactly one instance in your project. More...
Properties | |
static T | Instance [get] |
Get the singleton instance of the script. More... | |
![]() | |
abstract string | ResourceFolderPath [get] |
Return the path at which the Resources folder containing this asset lives. More... | |
abstract string | ResourcePath [get] |
Returns the path of this asset relative to its Resources folder. More... | |
Base class that makes it easier to write ScriptableObjects that always have exactly one instance in your project.
Similar to Singleton, but for ScriptableObjects. You specify a path in your subclass where the instance should live (this must be under a Resources folder) and the editor will automatically handle loading and even creating this asset for you when needed.
T | Pass the name of the inheriting class here to set the type of Instance. |
T | : | SingletonAssetBase |
|
staticget |
Get the singleton instance of the script.
If it hasn't been loaded yet, will try to load from SingletonAssetBase.ResourcePath. If in the editor and the asset doesn't exist, it will be created at SingletonAssetBase.ResourceFolderPath/SingletonAssetBase.ResourcePath. Otherwise, the cached instance (or null) will be returned.