-
-
Save anchan828/87d498e140d1a0488b3b 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 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