Namespace UnityEditor?

Now I don’t know if I am missing anything, but after compiling a game I got the error "The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?"

Compiler strips UnityEditor.

Use…

#if UNITY_EDITOR
using UnityEditor;
#endif

...

Also need to do that for any editor code inside your runtime scripts.

1 Like

Thanks for that, seems to be working fine :slight_smile:

1 Like