# AddObjectToAsset

> Adds an object to the result of the import.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.AssetImporters](/engine/7000.0/script-reference/unityeditor/assetimporters.md)
* **Assembly:** UnityEditor.CoreModule

## AddObjectToAsset(string, Object)

Adds an object to the result of the import.

```csharp
public void AddObjectToAsset(string identifier, Object obj)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A unique identifier for the object within the asset file.**** (\[Object]\(/engine/7000.0/script-reference/unityengine/object)): The Unity object to add to the import result.

### 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](/engine/7000.0/script-reference/unityengine/texture2d.md).

## AddObjectToAsset(string, Object, Texture2D)

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

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

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A unique identifier for the object within the asset file.**** (\[Object]\(/engine/7000.0/script-reference/unityengine/object)): The Unity object to add to the import result.**** (\[Texture2D]\(/engine/7000.0/script-reference/unityengine/texture2d)): The texture to use as the thumbnail for the object.

### 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.
