Created
November 10, 2019 17:13
-
-
Save gekidoslair/359535dd108ce3dfac6b564ad37e42fe to your computer and use it in GitHub Desktop.
Adds 'Create Empty at Root' shortcut for the GameObject / right-click context menu to create an empty gameobject at 0,0,0
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 UnityEditor; | |
using UnityEngine; | |
namespace MWU.Shared.Utilities | |
{ | |
public class CreateEmptyAtRoot : MonoBehaviour | |
{ | |
[MenuItem("GameObject/Create Empty at Root", false, 0)] | |
public static void Create() | |
{ | |
var go = new GameObject(); | |
go.name = "GameObject"; | |
go.transform.position = Vector3.zero; | |
go.transform.rotation = Quaternion.identity; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I added this to a utilities package that is available here:
https://github.com/PixelWizards/com.pixelwizards.utilities