I have got game object which uses UnityEditor. This object holds some textures for other UnityEditor scripts.
How can I exclude this game object from build?
Because during build “UnityEditor” could not be found (which is obvious).
#if UNITY_EDITOR
// editor code here
#endif
–Eric
Thank you. Very helpful tip.
OK. I have used your tip very simply: just pasted all my script between your #if UNITY_EDITOR tag. And it works, I have no “UnityEditor” errors during build.
But as I mentioned the gameObject which uses this script holds references to a lot of textures which are neccessary for this script but not neccessary during build. And now I am wondering if #if UNITY_EDITOR is enough to exclude this textures from build.
?
Look at the build log and see what it says.
–Eric