public static void MakePunyPlaneAsChildOfSelection() { // We start by creating a PunyPlane in the top level of the // Heirarchy. PunyPlane pp = PunyPlane.Create(); // And if we've got a GameObject currently selected in the // heirarchy, we'll reparent the PunyPlane to our selected // object. if (Selection.activeGameObject) { pp.gameObject.transform.parent = Selection.activeGameObject.transform; } }
public static void MakePunyPlane() { // This function simply creates a PunyPlane in the top level of the // Heirarchy. PunyPlane.Create(); }