LoadAssetAtPath
Returns a resource at an asset path (Editor Only).
Read time 1 minuteLast updated 2 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
LoadAssetAtPath(string, Type)
Returns a resource at an asset path (Editor Only).
public static Object LoadAssetAtPath(string assetPath, Type type)
Parameters
Returns
Type | Description |
|---|---|
| Object |
Remarks
This function always return null in the standalone player or web player. This is useful for quickly accessing an asset for use in the editor only.
Note: All asset names and paths in Unity use forward slashes, paths using backslashes will not work.
This returns only asset object that is visible in the Project view.
Resources.LoadAssetAtPath is deprecated. Use AssetDatabase.LoadAssetAtPath instead.
Note that web player is not supported from 5.4.0 onwards.
LoadAssetAtPath<T>(string)
Returns a resource at an asset path (Editor Only).
public static T LoadAssetAtPath<T>(string assetPath) where T : Object
Parameters
Pathname of the target asset.
Returns
Type | Description |
|---|---|
| T |
Remarks
This function always return null in the standalone player or web player. This is useful for quickly accessing an asset for use in the editor only.
Note: All asset names and paths in Unity use forward slashes, paths using backslashes will not work.
This returns only asset object that is visible in the Project view.
Note that web player is not supported from 5.4.0 onwards.