Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.