static public void AddTexture() { GameObject go = NGUIEditorTools.SelectedRoot(true); if (go != null) { Selection.activeGameObject = NGUISettingsEx.AddTexture(go).gameObject; } else { Debug.Log("You must select a game object first."); } }
static void AddPanel() { UIPanelEx panel = NGUISettingsEx.AddPanel(NGUIMenu.SelectedRoot()); Selection.activeGameObject = (panel == null) ? NGUIEditorTools.SelectedRoot(true) : panel.gameObject; }