# AssetImportContext

> Defines the import context for scripted importers during an import event.

## Definition

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

```csharp
public class AssetImportContext
```

## Remarks

This class carries both input and output information for the OnImportAsset() task.

## Properties

| Property                                                                                                                    | Description                                                                                                  |
| --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| [assetPath](/engine/6000.7/script-reference/unityeditor/assetimporters/assetimportcontext/assetpath.md)                     | The path of the source asset file to be imported.                                                            |
| [mainObject](/engine/6000.7/script-reference/unityeditor/assetimporters/assetimportcontext/mainobject.md)                   | The main object set on the AssetImportContext.                                                               |
| [selectedBuildTarget](/engine/6000.7/script-reference/unityeditor/assetimporters/assetimportcontext/selectedbuildtarget.md) | Returns the current build target and creates a dependency on the target platform within a scripted importer. |

## Methods

| Method                                                                                                                                          | Description                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| [AddObjectToAsset](/engine/6000.7/script-reference/unityeditor/assetimporters/assetimportcontext/addobjecttoasset.md)                           | Adds an object to the result of the import operation.                                                                                        |
| [DependsOnArtifact](/engine/6000.7/script-reference/unityeditor/assetimporters/assetimportcontext/dependsonartifact.md)                         | Sets up an artifact dependency to an asset.                                                                                                  |
| [DependsOnCustomDependency](/engine/6000.7/script-reference/unityeditor/assetimporters/assetimportcontext/dependsoncustomdependency.md)         | Allows you to specify that an Asset has a custom dependency.                                                                                 |
| [DependsOnSourceAsset](/engine/6000.7/script-reference/unityeditor/assetimporters/assetimportcontext/dependsonsourceasset.md)                   | Allows you to specify that an Asset depends directly on the source file of another Asset (as opposed to the import result of another asset). |
| [GetArtifactData](/engine/6000.7/script-reference/unityeditor/assetimporters/assetimportcontext/getartifactdata.md)                             | Returns the data of the artifact file that was created by another importer, and adds a dependency to that file and the source asset path.    |
| [GetObjects](/engine/6000.7/script-reference/unityeditor/assetimporters/assetimportcontext/getobjects.md)                                       | Gets the list of objects set on the AssetImportContext.                                                                                      |
| [GetReferenceToAssetMainObject](/engine/6000.7/script-reference/unityeditor/assetimporters/assetimportcontext/getreferencetoassetmainobject.md) | Returns the main asset from the given path (if it exists) and automatically adds a dependency on its path if it is the main asset type.      |
| [LogImportError](/engine/6000.7/script-reference/unityeditor/assetimporters/assetimportcontext/logimporterror.md)                               | Logs an error message encountered during import.                                                                                             |
| [LogImportWarning](/engine/6000.7/script-reference/unityeditor/assetimporters/assetimportcontext/logimportwarning.md)                           | Logs a warning message encountered during import.                                                                                            |
| [SetMainObject](/engine/6000.7/script-reference/unityeditor/assetimporters/assetimportcontext/setmainobject.md)                                 | Sets the main object for import.                                                                                                             |
| [SetOutputArtifactData](/engine/6000.7/script-reference/unityeditor/assetimporters/assetimportcontext/setoutputartifactdata.md)                 | Sets the data to be written to the artifact file.                                                                                            |
| [SetOutputArtifactFile](/engine/6000.7/script-reference/unityeditor/assetimporters/assetimportcontext/setoutputartifactfile.md)                 | Sets the data to be written to the artifact file with the given extension, by reading it from the file at the supplied path.                 |
