I have a structure like so for an editor tool I’m working on:
Scripts
Tool classes
Tool.asmdef
EditorTool editor classes
Tool.Editor.asmdef
I want to conditionally exclude all of these classes from any builds, so I made the only platform for both asmdefs the Editor. I also added a UNITY_EDITOR constraint to the asmdefs too. I have a MonoBehaviour in the Scripts folder that is marked [ExecuteInEditMode], however this script stopped loading and if I try to add it to a game object I get an error about it being an Editor script. I assume this is the asmdef that is causing this, is there a way to get this script to load while conditionally excluding this code from builds? Thanks