Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

AssetImportContext.AddObjectToAsset

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void AddObjectToAsset(string identifier, Object obj);

Parameters

Parameter Description
identifier A unique identifier for the object within the asset file.
obj The Unity object to add to the import result.

Description

Adds an object to the result of the import.

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.


Declaration

public void AddObjectToAsset(string identifier, Object obj, Texture2D thumbnail);

Parameters

Parameter Description
identifier A unique identifier for the object within the asset file.
obj The Unity object to add to the import result.
thumbnail The texture to use as the thumbnail for the object.

Description

Adds an object to the result of the import, with a thumbnail.

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.