Fixed, look at the edit. Maybe the same fix should be applied to next NGUI update?Hi,
I'm trying to build my project for WP8.
I'm using Unity 4.5 with NGUI 3.6.3.
When I go to build and it starts compiling the scripts, I get the following error:
Assets/NGUI/Scripts/Internal/NGUITools.cs(470,17): error CS0103: The name `UnityEditor' does not exist in the current context
This is the line triggering the error:
UnityEditor.Undo.RegisterCreatedObjectUndo(go, "Create Object");
I tried to add a "using UnityEditor;" on top of the script and I get the error again, this time on the line where I put the "using" instruction and asking if I'm missing an assembly reference.
I checked on my Assembly-CSharp/References and the UnityEditor.dll is there.
Any advice?
Edit:
I wrapped line 470 of NGUITools.cs with the platform dependent directive:
#IF UNITY_EDITOR
UnityEditor.Undo.RegisterCreatedObjectUndo(go, "Create Object");
#endif
and it stopped giving the error.
It seems that a built game cannot use the UnityEditor namespace.