I suggest that you explicitly use UnityEditor namespace to avoid compilation errors do to ambiguous names.
Every reference to Editor could be ambiguous even if placed inside #if UNITY_EDITOR.
I think this is related to UNITY version and maybe 2019 series did it different than later ones!?
When I first encountered this I just fixed it without any regards that I could give back something or even contribute a bit.
Anyway to be on the safe side it is better to use
public class PageControllerEditor : UnityEditor.Editor
instead of
public class PageControllerEditor : Editor
or put import
using UnityEditor;
You can also create an alias for a namespace or a type with a using alias directive.
using Editor = UnityEditor.Editor;
That's an interesting suggestion. While I haven't had much trouble with ambiguous names, I often forget to place the import inside #if UNITY_EDITOR. I'll try it like you mentioned it.
I suggest that you explicitly use UnityEditor namespace to avoid compilation errors do to ambiguous names. Every reference to
Editor
could be ambiguous even if placed inside #if UNITY_EDITOR. I think this is related to UNITY version and maybe 2019 series did it different than later ones!?When I first encountered this I just fixed it without any regards that I could give back something or even contribute a bit.
Anyway to be on the safe side it is better to use
public class PageControllerEditor : UnityEditor.Editor
instead ofpublic class PageControllerEditor : Editor
or put importusing UnityEditor;
You can also create an alias for a namespace or a type with a using alias directive.
using Editor = UnityEditor.Editor;