Version: 2020.3
  • C#


Suggest a change


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.


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.




public static void RegisterCustomDependency(string dependency, Hash128 hashOfValue);


dependency Name of dependency. You can use any name you like, but because these names are global across all your Assets, it can be useful to use a naming convention (eg a path-based naming system) to avoid clashes with other custom dependency names.
hashOfValue A Hash128 value of the dependency.


Allows you to register a custom dependency that Assets can be dependent on. If you register a custom dependency, and specify that an Asset is dependent on it, then the Asset will get re-imported if the custom dependency changes.

If an asset has a dependency to a custom dependency and the hash value of the custom dependency is changed, then the asset will get reimported. You can change the hash by calling RegisterCustomDependency again, and passing the same name, and a new value for the hash.

The reimport happens when either AssetDatabase.Refresh is called or it imported using AssetDatabase.ImportAsset().

For an example for how to use custom dependencies goto AssetImportContext.DependsOnCustomDependency

You should not call RegisterCustomDependency from any code that is executed during the Asset import process. If you do, this method will throw an exception.