# AssetImportContext

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

## Definition

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

```csharp
public class AssetImportContext
```

## Remarks

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

## Properties

| Property                                                                                                                    | Description                                                                                                  |
| --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| [assetPath](/engine/6000.0/script-reference/unityeditor/assetimporters/assetimportcontext/assetpath.md)                     | The path of the source asset file to be imported.                                                            |
| [mainObject](/engine/6000.0/script-reference/unityeditor/assetimporters/assetimportcontext/mainobject.md)                   | The main object set on the AssetImportContext.                                                               |
| [selectedBuildTarget](/engine/6000.0/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.0/script-reference/unityeditor/assetimporters/assetimportcontext/addobjecttoasset.md)                           | Adds an object to the result of the import operation.                                                                                        |
| [DependsOnArtifact](/engine/6000.0/script-reference/unityeditor/assetimporters/assetimportcontext/dependsonartifact.md)                         | Setup artifact dependency to an asset.                                                                                                       |
| [DependsOnCustomDependency](/engine/6000.0/script-reference/unityeditor/assetimporters/assetimportcontext/dependsoncustomdependency.md)         | Allows you to specify that an Asset has a custom dependency.                                                                                 |
| [DependsOnSourceAsset](/engine/6000.0/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). |
| [GetArtifactFilePath](/engine/6000.0/script-reference/unityeditor/assetimporters/assetimportcontext/getartifactfilepath.md)                     | Returns the path 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.0/script-reference/unityeditor/assetimporters/assetimportcontext/getobjects.md)                                       | Gets the list of objects set on the AssetImportContext.                                                                                      |
| [GetOutputArtifactFilePath](/engine/6000.0/script-reference/unityeditor/assetimporters/assetimportcontext/getoutputartifactfilepath.md)         | Returns the path where to write a new Artifact File with the given fileName.                                                                 |
| [GetReferenceToAssetMainObject](/engine/6000.0/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.0/script-reference/unityeditor/assetimporters/assetimportcontext/logimporterror.md)                               | Logs an error message encountered during import.                                                                                             |
| [LogImportWarning](/engine/6000.0/script-reference/unityeditor/assetimporters/assetimportcontext/logimportwarning.md)                           | Logs a warning message encountered during import.                                                                                            |
| [SetMainObject](/engine/6000.0/script-reference/unityeditor/assetimporters/assetimportcontext/setmainobject.md)                                 | Sets the main object for import.                                                                                                             |
