Unity-Dependencies-Hunter icon indicating copy to clipboard operation
Unity-Dependencies-Hunter copied to clipboard

Addressables references

Open Wnntyl opened this issue 3 years ago • 2 comments

I suggest adding support for finding dependencies by AssetReferences too

Wnntyl avatar Nov 23 '21 11:11 Wnntyl

Concerning Addressables: for now, you can filter them in the search results AssetReferences support is currently WIP

AlexeyPerov avatar Feb 20 '22 17:02 AlexeyPerov

Hello, I just found this package and it is amazing!

I'm wondering if the Addressable search support will be added for Package Manager users as it is described in the README file. I tried it just now and it appears to have failed since the asmdef file has no reference to the Addressable asmdef, which is fair since Addressables aren't a dependency for this package by default. To fix this problem for any Package Manager user I think you can just add an Assembly Definition Reference by name to the Addressables asmdef, then add this reference in the project's main Assembly Definition, this way if you add Addressables to a project that has this package as a dependency it will get the reference by the name and if you don't add Addressables it will just be a missing reference and Unity will ignore it. I didn't try it, so it might not work like that.

For now I can use it without the Package manager, but I won't get the newest updates automatically... :(

As a tip: I noticed I have to uncomment a line to define a macro to enable the Addressable search code, but I used Package Manager to import the package so I can't change any scripts inside that package as it won't be saved. Solution: Add the macro definition for HUNT_ADDRESSABLES inside Unity's Player Settings (Other Settings->Scripting Define Symbols). This solution sounds even better than the default one because nobody has to touch any script files, which is more inclusive for non-programmers (game designers, artists, ...).

Anyway, have a great day!

CampioniMan avatar Feb 16 '23 00:02 CampioniMan