I'm using NGUI 3.6.3
in NGUITools.cs
/// <summary>
/// Instantiate an object and add it to the specified parent.
/// </summary>
static public GameObject AddChild (GameObject parent, GameObject prefab)
{
GameObject go = GameObject.Instantiate(prefab) as GameObject;
UnityEditor
.Undo.RegisterCreatedObjectUndo(go,
"Create Object"); <-- this is a problem
if (go != null && parent != null)
{
Transform t = go.transform;
t.parent = parent.transform;
t.localPosition = Vector3.zero;
t.localRotation = Quaternion.identity;
t.localScale = Vector3.one;
go.layer = parent.layer;
}
return go;
}
There is an compile error in NGUITools.AddChild() when building game.
It is ok when simply playing in editor but it isn't ok when building.
I think that the problem is removing "UNITY_EDITOR" define.