- Home /
How exactly does Unity find editor extensions?
Just noticed that my EditorWindow derived class is recognized by Unity as editor extension even if it doesn't have Editor folder in its path. Also noticed that Unity includes it in user scripts project (not the Editor one). So how exactly does Unity find editor extensions?
Answer by Bunny83 · Oct 30, 2017 at 10:14 AM
I'm not quite sure what you mean. Unity compiles all scripts in your project in several "phases" where each "phase" results in a seperate assembly. To which phase a script belongs is determined by the folders you place your scripts in.
Note: If you use any editor related code in a runtime "phase" it does work when compiled in the editor. However you can no longer build your game as when building the game you can't use anything from the UnityEditor namespace since the UnityEditor.dll is not available outside of the Unity editor.
That's why you have to put your editor scripts into a folder named "editor" so those classes are not compiled into the runtime assemblies but into the seperate editor assemblies which aren't included in your build.
Your answer
Follow this Question
Related Questions
EditorWindow Menu 1 Answer
Keep custom handles always visible in editor 2 Answers
Style labels in editor window (in scene view) 0 Answers
Possible to set 'Scene Gizmo' position in custom 'Scene View Window'? 0 Answers
Text in custom editor is displayed/rendered with boxes around characters... 2 Answers