Init(args)
Scripting Reference
Loading...
Searching...
No Matches

◆ Resource() [1/2]

static bool Sisus.Init.Find.Resource ( [DisallowNull] Type type,
[DisallowNull] string path,
[NotNullWhen(true), MaybeNullWhen(false)] out object result )
static

Loads the asset of the given type stored at path in a Resources folder.

Parameters
typeType of the asset to load.

Assets match the search criteria if their class is of type T , if their class derives from a base class of type T , or their class implements an interface of type T .

Only objects whose classes derive from Component or ScriptableObject or objects that are wrapped by a IWrapper<T> can be returned.

Parameters
pathPath to the target resource to load.
resultWhen this method returns, contains loaded instance, if found; otherwise, null. This parameter is passed uninitialized.
Returns
true if an asset was found; otherwise, false.