Method GetAssetID
|
Improve this Doc
View Source
GetAssetID(Type, string)
Finds the AssetID by an asset name at runtime.
The closed matching base type must be used.
E.g. for prefabs use GameObject, for Textures use Texture2D etc.
If no asset is found, an invalid AssetID is returned.
Declaration
public AssetID GetAssetID(Type type, string name)
Parameters
Type |
Name |
Description |
Type |
type |
Asset type to search for |
string |
name |
Asset name to search for |
Returns
Type |
Description |
AssetID |
The AssetID of the searched asset if found, otherwise an invalid AssetID |
Exceptions
|
Improve this Doc
View Source
GetAssetID<T>(string)
Finds the AssetID by an asset name at runtime.
The closed matching base type must be used.
E.g. for prefabs use GameObject, for Textures use Texture2D etc.
If no asset is found, an invalid AssetID is returned.
Declaration
public AssetID GetAssetID<T>(string name) where T : UnityEngine.Object
Parameters
Type |
Name |
Description |
string |
name |
Asset name to search for |
Returns
Type Parameters
Name |
Description |
T |
Asset type to search for |
Exceptions