Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

AssetDatabase.LoadMainAssetAtPath

static function LoadMainAssetAtPath(assetPath: string): Object;
static Object LoadMainAssetAtPath(string assetPath);
static def LoadMainAssetAtPath(assetPath as string) as Object

Parameters

assetPathFilesystem path of the asset to load.

Description

Returns the main asset object at assetPath.

All paths are relative to the project folder, for example: "Assets/MyTextures/hello.png"

See Also: AssetDatabase.LoadAssetAtPath, AssetDatabase.LoadAllAssetsAtPath.