AddObjectToAsset
Adds an object to the result of the import.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Method
- Namespace: UnityEditor.AssetImporters
- Assembly: UnityEditor.CoreModule
AddObjectToAsset(string, Object)
Adds an object to the result of the import.
public void AddObjectToAsset(string identifier, Object obj)
Parameters
Remarks
Use this method to add objects to the result of the import. You can call it several times if the import produces more than one Unity object. Give each object an identifier that's unique within the asset file, and make sure the importer generates the same identifier every time it reimports the file. Unity uses the identifiers to match previously imported objects with newly created ones. This overload doesn't set a thumbnail. To set one, use the overload that takes a Texture2D.
AddObjectToAsset(string, Object, Texture2D)
Adds an object to the result of the import, with a thumbnail.
public void AddObjectToAsset(string identifier, Object obj, Texture2D thumbnail)
Parameters
Remarks
Use this method to add objects to the result of the import. You can call it several times if the import produces more than one Unity object. Give each object an identifier that's unique within the asset file, and make sure the importer generates the same identifier every time it reimports the file. Unity uses the identifiers to match previously imported objects with newly created ones.