Kanda Foundation 0.2.0
Loading...
Searching...
No Matches
EditorSettingsAssetUtils Class Reference

A collection of editor utilities to read and write settings assets. More...

Static Public Member Functions

static T GetOrCreateSettingsAssetInResources< T > (string resourcesRelativePath)
 Get a settings asset from Resources. If asset does not exist, it will be created and populated with default values.
 
static T CreateSettingsAssetInResources< T > (string resourcesRelativePath)
 Creates a settings asset in Resources.
 
static void TryCreateDirectoryFromAssetPath (string assetPath)
 Creates a directory for a given asset path if it does not exist.
 

Detailed Description

A collection of editor utilities to read and write settings assets.

Member Function Documentation

◆ CreateSettingsAssetInResources< T >()

static T CreateSettingsAssetInResources< T > ( string resourcesRelativePath)
inlinestatic

Creates a settings asset in Resources.

Parameters
resourcesRelativePathThe path of the asset relative to the resources folder.
Template Parameters
TThe type of asset to be created.
Returns
An instance of the asset object which was created.
Type Constraints
T :ScriptableObject 
T :IKandaSettings 

◆ GetOrCreateSettingsAssetInResources< T >()

static T GetOrCreateSettingsAssetInResources< T > ( string resourcesRelativePath)
inlinestatic

Get a settings asset from Resources. If asset does not exist, it will be created and populated with default values.

Parameters
resourcesRelativePathThe path of the asset relative to the resources folder.
Template Parameters
TThe type of asset to be created.
Returns
An instance of the asset object which was either gotten or created.

If referring to an asset stored at Assets/Resources/MyFolder/MyAsset.asset:

GetOrCreateSettingsAssetInResources<MyAsset>("MyFolder/MyAsset");
Type Constraints
T :ScriptableObject 
T :IKandaSettings 

◆ TryCreateDirectoryFromAssetPath()

static void TryCreateDirectoryFromAssetPath ( string assetPath)
inlinestatic

Creates a directory for a given asset path if it does not exist.

Parameters
assetPathThe asset path to create directory for.

The documentation for this class was generated from the following file: