foreach(Transform t in selection) t.parent = newParent.transform; } // Disable the menu if there is nothing selected [MenuItem ("Example/Create Parent For Selection _p", true)] staticbool ValidateSelection() { returnSelection.activeGameObject != null; } }