Editor script in /Editor, yet throws build err?


Library\PackageCache\com.some.embedded.test.pkg@123*\Editor*\SomeEditorScript.cs(9,41): error CS0246: The type or namespace name 'EditorWindow' could not be found (are you missing a using directive or an assembly reference?)

This is in an /Editor dir for editor tooling, so why would this dir even be considered for builds?

Probably because it's under a non-editor assembly definition, which overrides the special 'Editor' folder rule (and all other special folders, in fact).


Did you properly restrict your assembly to be Editor-only? Packages require asmdef for code, and folder name doesn't matter for asmdefs, it's the assembly definition that does the work.


Ah this was it -- good to know that these override special perms. Thanks @Spy-Master + @spiney199

I‘m pretty sure a Resources folder continues to function as expected, asmdef or not. That may simply be because Resources do not contain scripts, so I tend to think asmdef only affect special folders that are special for scripts but not any non-script special folder. True or false? I‘m leaning towards true but not 100% certain.

Well Resources has nothing to do with script compilation.