truongnguyentungduy / hierarchy-2

Editor extension to improve Unity hierarchy window. Makes the hierarchy more detail, but still clean and easy to organize.
MIT License
154 stars 43 forks source link

This package must have Assembly Definitions (Editor and Runtime) #1

Closed renatopp closed 2 years ago

renatopp commented 4 years ago

Hi!

First of all, great job with this library, it is really great and useful.

I hope to create a PR later today.

truongnguyentungduy commented 4 years ago

I'm quite curious about this issue. I have used it in a lot of projects and built on windows, android and ios platforms without any problems. I wonder if I have missed any special cases? Currently, only HierarchyLocalData.cs (Used to contain custom elements, not appear in the hierarchy) is MonoBehaviour script. Gameobject has it tagged as "EditorOnly" and will be deleted when building the game.

renatopp commented 4 years ago

Hi @truongnguyentungduy, I still don't know exactly the particularities of how Unity does its stuff, but, AFAIK, once you use assembly definitions in your project, you have to use it everywhere, including 3rd party packages.

Once you use asmdefs in your project, the magic folder seems to lose their meaning for building. So, since the Hierarchy2's editor scripts are not contained with a assembly definition, when you build the project they are included in the solution.

yasirkula commented 3 years ago

I can't comment about build errors but there are 2 other benefits of adding Assembly Definition Files:

If you are interested in UPM support, I'd like to promote the repository structure I've been using for my packages which has worked well for me with minimal changes.