static public void AddTextureEx() { GameObject go = NGUIEditorTools.SelectedRoot(true); if (go != null) { Selection.activeGameObject = NGUISettings.AddTextureEx(go).gameObject; } else { Debug.Log("You must select a game object first."); } }