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

◆ Load< T >()

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

Loads an asset at path.

  • Will import the asset if it is not yet in the AssetDatabase.
  • Will only load visible sub-objects. Returns the first object of the type found.
  • Use CodeSmileEditor.Asset.SubAsset.LoadVisible if you need a specific sub-asset.
Parameters
pathPath to an asset file.
Template Parameters
TUnityEngine.Object derived type.
Returns
The loaded asset object, or null if the asset does not exist or does not contain a visible object of type T.
See also
Type Constraints
T :Object 

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

366 : Object
367 {
368 ThrowIf.ArgumentIsNull(path, nameof(path));
369
370 ImportIfNotImported(path);
371 return AssetDatabase.LoadAssetAtPath<T>(path);
372 }