AddObjectToAsset
Adds an object to the result of the import operation.
Read time 2 minutesLast updated 19 days ago
Definition
- Type: Method
- Namespace: UnityEditor.AssetImporters
- Assembly: UnityEditor.CoreModule
AddObjectToAsset(string, Object)
Adds an object to the result of the import operation.
public void AddObjectToAsset(string identifier, Object obj)
Parameters
Remarks
Use this method to add objects to the resulting asset. AddObjectToAsset can be called multiple times if more than one unity object is the result of the import process. Note: You must make sure that your importer provides a unique identifier for each added object. You must also make sure that your code regenerates the same identifier each time the file is re-imported: identifiers should be deterministic. This allows Unity to keep match previously imported objects with the newly created objects. The identifier only needs to be unique within the context of the Asset file and not globally unique across your whole project.
AddObjectToAsset(string, Object, Texture2D)
Adds an object to the result of the import operation.
public void AddObjectToAsset(string identifier, Object obj, Texture2D thumbnail)
Parameters
Remarks
Use this method to add objects to the resulting asset. AddObjectToAsset can be called multiple times if more than one unity object is the result of the import process. Note: You must make sure that your importer provides a unique identifier for each added object. You must also make sure that your code regenerates the same identifier each time the file is re-imported: identifiers should be deterministic. This allows Unity to keep match previously imported objects with the newly created objects. The identifier only needs to be unique within the context of the Asset file and not globally unique across your whole project.