Error while using an Editor namespace when Assets use Editor as a type (UnityEditor.Editor)

Hey guys, I hope you are all good

I am currently writing an Assets that is using both runtime and Editor, you can find the code there.
When importing my Asset in another project I get an error:
“Editor” is namespace but is used like a type

After looking through the scripts, I understood that the error came from the fact that:

  • The other scripts are extending Editor (UnityEditor.Editor)
  • I have an Editor namespace in my asset

There the hierarchy of my asset:
7101754--846565--upload_2021-5-3_11-31-3.png

Do guys have any suggestions to fix that?
I can’t modify the other scripts as they are from the Asset Store.

Have a nice day

P.S: We also have the Input System package in the project which has an Editor namespace and we don’t get errors for that. I may miss something.

  • Avoid using Editor as a namespace
  • If you insist on using Editor in a namespace, make sure it’s not the first element, so use MyAssetPackage.Editor.

Here’s the problem file:

2 Likes

Oh yeah ,thanks for the help !
I was mimicing the Input System and Atom package, that’s why I have an Editor namespace.
Anyway, thanks a lot !