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