How Sprite Atlas v2 implements folder contents dependency? (SourceAsset/HashOfGuidsOfChildren/{GUID})

Hello, while working with Sprite Atlas v2, the version that uses AssetImporter to import *.spriteatlasv2 files and generates SpriteAtlas : Object as import artifact.

  • You can specify folders in atlas Packables \ Objects for Packing array and atlas will get re-imported whenever content of that folder changed (sprites deleted, added, etc…).
    This atlas will have one folder for example:
    Example folder dependency

  • If we open sprite atlas in import activity window



  • We can see that it has dependency called SourceAsset/HashOfGuidsOfChildren/69cff30118fbd8745952ca6f80dac6b8 where hex at the end is GUID of referenced folder.
    GUID of referenced folder

Similar dependencies to either import artifact change, or sourсe asset change can be defined in import pipeline with AssetImportContext.DependsOnArtifact(), AssetImportContext.DependsOnSourceAsset() and AssetImportContext.DependsOnCustomDependency(). But I did not found any way to specify dependency to folder content change…

Another solution to get some asset re-imported whenever certain folder changes is to use FileSystemWatcher Class to track required folders, but this also seems weird, and like it might interrupt Unity’s AssetDatabase IO.

I assume API for adding dependencies for folder content exist only on C++ side, and not presented in any form on C# side. (Atleas I did not found it )

Questions for Unity Employees:

Why does API for adding dependencies for folder contents hash SourceAsset/HashOfGuidsOfChildren/{GUID} is not exposed?

Is there maybe some hacky way to still add those kind of dependencies?

Are you planing to expose this API in future?