Skip to content

Instantly share code, notes, and snippets.

@anchan828
Created October 2, 2013 09:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anchan828/87d498e140d1a0488b3b to your computer and use it in GitHub Desktop.
Save anchan828/87d498e140d1a0488b3b to your computer and use it in GitHub Desktop.
using UnityEditor;
using UnityEngine;
public class Question1_practical
{
[MenuItem("GameObject/Create Child Empty &#n", true)]
static bool Validate()
{
return Selection.activeTransform;
}
[MenuItem("GameObject/Create Child Empty &#n", false)]
static void Create()
{
GameObject child = new GameObject("child");
child.transform.parent = Selection.activeTransform;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment