- Home /
Editor Scene?
I have to do some editor scripting in my project and I also want to use unity scene for editor job and I'm not gonna use that scene in my game. The problem is that I can't assign editor monobehaviour scripts to gameobjects of my 'editor scene'. Can this problem be solved?
Sorry if I made mistakes in my English.
If you mean $$anonymous$$onoBehaviours located inside an Editor folder then yes you can't assign them, but why you want them to be inside an Editor folder? The implications are that said classes will be included on the runtime Assembly, which fairs the risk of wrongfull usage inside the build, but it is preventable via simple means as proper na$$anonymous$$g, maybe throw an exception if it is used on Build but that depends on its usage. Anyway it is not worth it to fight the engine and play along. Odds are it is doable but definitely not worth the hustle.
Editor scripts shouldn't be mixed with $$anonymous$$onoBehaviour classes, keep them separate. if you must, wrap the editor specific code in #if UNITY_EDITOR, #endif and do not put the $$anonymous$$onoBehaviours into Editor folders