static public void AddWidget() { GameObject go = NGUIEditorTools.SelectedRoot(true); if (go != null) { Selection.activeGameObject = NGUISettings.AddWidget(go).gameObject; } //else Debug.Log("You must select a game object first."); }
static public void AddWidget() { GameObject go = NGUIEditorTools.SelectedRoot(true); if (go != null) { #if UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 Undo.RegisterSceneUndo("Add a Widget"); #endif Selection.activeGameObject = NGUISettings.AddWidget(go).gameObject; } else { Debug.Log("You must select a game object first."); } }