# CollectImportedDependenciesAttribute(Type, uint)

> Use the CollectImportedDependencies attribute to declare getters for imported dependencies.

## Definition

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

```csharp
public CollectImportedDependenciesAttribute(Type importerType, uint version)
```

### Parameters

**** (\[Type]\(https\://learn.microsoft.com/dotnet/api/system.type)): The type of the importer for which the getter is called by the [AssetDatabase](/engine/6000.3/script-reference/unityeditor/assetdatabase.md).**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): The version of the imported dependencies getter.

### Remarks

It is recommended to always increment the version number of the callback whenever the script is changed. This forces assets imported with lower version numbers to be re-imported.

This example shows how you can declare a dependency between two prefabs imported by the [ModelImporter](/engine/6000.3/script-reference/unityeditor/modelimporter.md) and use them in an AssetPostprocessor.

```csharp
using UnityEditor;
using UnityEditor.AssetImporters;
using UnityEngine;

public class ProceduralParentPostprocessor : AssetPostprocessor
{
    private const string s_DependentPath = "Assets/ProceduralPrefab.fbx";
    private const string s_DependencyPath = "Assets/DependencyPrefab.fbx";

    [CollectImportedDependencies(typeof(ModelImporter), 1)]
    public static string[] CollectImportedDependenciesForModelImporter(string assetPath)
    {
        if (assetPath.Equals(s_DependentPath))
            return new[] { s_DependencyPath };

        return null;
    }

    void OnPostprocessMeshHierarchy(GameObject root)
    {
        if (root.name == "ProceduralPrefabRoot")
        {
            // Add a new child game object
            var go = AssetDatabase.LoadMainAssetAtPath(s_DependencyPath) as GameObject;
            Object.Instantiate(go, root.transform, true);
        }
    }
}
```

**Note:** The attribute supports only native importer types with [AssetPostprocessor](/engine/6000.3/script-reference/unityeditor/assetpostprocessor.md) callbacks: [ModelImporter](/engine/6000.3/script-reference/unityeditor/modelimporter.md), [TextureImporter](/engine/6000.3/script-reference/unityeditor/textureimporter.md), [AudioImporter](/engine/6000.3/script-reference/unityeditor/audioimporter.md), and [SpeedTreeImporter](/engine/6000.3/script-reference/unityeditor/speedtreeimporter.md).
