CodeSmile AssetDatabase 1.9
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 411 of file Asset.File.cs.

411 : Object
412 {
413 ThrowIf.ArgumentIsNull(path, nameof(path));
414 ThrowIf.DoesNotExistInFileSystem(path);
415
416 ImportIfNotImported(path);
417 return AssetDatabase.LoadMainAssetAtPath(path) as T;
418 }