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

◆ LoadMain< T >() [1/2]

static T LoadMain< T > ( [NotNull] Path path)
static

Loads the main (root) asset at the path.

  • Will import the asset if it is not yet in the AssetDatabase.
Parameters
pathPath to an asset file.
Template Parameters
TUnityEngine.Object derived type.
Returns
The asset or null if the path does not exist.
See also
Type Constraints
T :Object 

Definition at line 416 of file Asset.File.cs.

416 : Object
417 {
418 ThrowIf.ArgumentIsNull(path, nameof(path));
419 ThrowIf.DoesNotExistInFileSystem(path);
420
421 ImportIfNotImported(path);
422 return AssetDatabase.LoadMainAssetAtPath(path) as T;
423 }