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; | |
} | |
} | |
} |
Fantastic idea, and something that I'm working internally to try and figure
out.
…On Wed., Nov. 13, 2019, 1:51 p.m. MostHated, ***@***.***> wrote:
Hey there, are these part of any sort of editor tools package? It would be
quite nice if there was a repo of these that could be added in the package
manager with all of them together instead of individual scripts.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<https://gist.github.com/359535dd108ce3dfac6b564ad37e42fe?email_source=notifications&email_token=ABCXP34EFPLVBDZVQU6VGILQTRZEPA5CNFSM4JNCDY6KYY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAF4EXE#gistcomment-3082610>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABCXP3ZYSHWKNAVEPEXYLQDQTRZEPANCNFSM4JNCDY6A>
.
I added this to a utilities package that is available here:
https://github.com/PixelWizards/com.pixelwizards.utilities
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey there, are these part of any sort of editor tools package? It would be quite nice if there was a repo of these that could be added in the package manager with all of them together instead of individual scripts.