Hey,
Not quite sure if it’s correct to flag the subject as “bug”, but it seems relevant to me at the moment. I will change it if required.
We are relying heavily on the EditorOnly tag of Unity to optimize our level design process. It’s really helpful to have a component and object-based post-process on your objects, especially mixed with our level editor.
Our level designer scripts are grouped in a folder having its own asmdef and are included only in Editor, since they are useless in build (and often contain editor code like PrefabUtility calls).
At our biggest surprise, Unity will refuse to have a script defined in Editor via an asmdef onto an EditorOnly game object:
If the game object is EditorOnly, then the script won’t be present at runtime, so it shouldn’t matter. We feel like there is a flaw in the whole “editor only” process of the Unity editor.
Is this an expected behaviour that will remain this way, or should it be fixed?
On a side note, it’s important to be aware that, as far as I know, the EditorOnly tag doesn’t work for prefabs instantiated at runtime, making this “script doesn’t exist at runtime” warning more relevant. Maybe this prefab behaviour should be considered an issue as well?

