Author Topic: android build error in NGUI 3.6.3  (Read 1946 times)

ntopia

  • Newbie
  • *
  • Thank You
  • -Given: 6
  • -Receive: 0
  • Posts: 15
    • View Profile
android build error in NGUI 3.6.3
« on: June 08, 2014, 08:43:19 AM »
I'm using NGUI 3.6.3

in NGUITools.cs
  1.         /// <summary>
  2.         /// Instantiate an object and add it to the specified parent.
  3.         /// </summary>
  4.  
  5.         static public GameObject AddChild (GameObject parent, GameObject prefab)
  6.         {
  7.                 GameObject go = GameObject.Instantiate(prefab) as GameObject;
  8.                 UnityEditor.Undo.RegisterCreatedObjectUndo(go, "Create Object");    <-- this is a problem
  9.  
  10.                 if (go != null && parent != null)
  11.                 {
  12.                         Transform t = go.transform;
  13.                         t.parent = parent.transform;
  14.                         t.localPosition = Vector3.zero;
  15.                         t.localRotation = Quaternion.identity;
  16.                         t.localScale = Vector3.one;
  17.                         go.layer = parent.layer;
  18.                 }
  19.                 return go;
  20.         }
  21.  

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.

Caio.Lib

  • Newbie
  • *
  • Thank You
  • -Given: 7
  • -Receive: 2
  • Posts: 26
    • View Profile
Re: android build error in NGUI 3.6.3
« Reply #1 on: June 08, 2014, 01:03:02 PM »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: android build error in NGUI 3.6.3
« Reply #2 on: June 09, 2014, 03:11:33 AM »
The 3.6.3b I put up yesterday already has this fixed.