Created
April 23, 2013 15:20
-
-
Save stramit/5444469 to your computer and use it in GitHub Desktop.
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; | |
//Put this under a folder called Editor in your project | |
public class EmptyGOCreator | |
{ | |
[MenuItem ("GameObject/Create Empty at level %g")] | |
static void CreateEmptyGOAtLevel () | |
{ | |
var go = new GameObject("GameObject"); | |
go.transform.parent = Selection.activeGameObject == null ? null : Selection.activeGameObject.transform.parent; | |
go.transform.position = Vector3.zero; | |
} | |
[MenuItem ("GameObject/Create Empty below level %k")] | |
static void CreateEmptyGOAsChild() | |
{ | |
var go = new GameObject("GameObject"); | |
go.transform.parent = Selection.activeGameObject == null ? null : Selection.activeGameObject.transform; | |
go.transform.position = Vector3.zero; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment