CodeSmile AssetDatabase 1.9
Unity's AssetDatabase in enjoyable, consistent, concise, convenient, comprehensible, safe, documented form.
Loading...
Searching...
No Matches

◆ CreateOrLoad< T >()

static T CreateOrLoad< T > ( [NotNull] Path path,
[NotNull] Func< T > getInstance )
static

Loads or creates an asset at path.

Will first attempt to load the asset at path. If this fails, will create an asset from the object returned by getInstance. This is an alias for CodeSmileEditor.Asset.LoadOrCreate{T}.

Parameters
pathPath to an asset file.
getInstanceFunc that returns a UnityEngine.Object
Template Parameters
TUnityEngine.Object derived type.
Returns
The loaded or created object of type T, or null if the object is not of type T. Note that the asset file gets created in this case.
See also
Type Constraints
T :Object