Created
October 31, 2013 21:31
-
-
Save xdegtyarev/7257570 to your computer and use it in GitHub Desktop.
Tiny Editor script, to create empty game object as a child to currently selected transform.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
public class CreateEmptyChild : MonoBehaviour { | |
[MenuItem("GameObject/Create Empty Child &#n")] | |
static void EmptyChild(){ | |
GameObject go = new GameObject("Empty"); | |
go.transform.parent = Selection.activeTransform; | |
go.transform.localPosition = Vector3.zero; | |
go.transform.localRotation = Quaternion.identity; | |
go.transform.localScale = Vector3.one; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment