Unity物体打组
2020-12-12 本文已影响0人
独步江雪
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
public class Toolbag
{
[MenuItem("Toolbag/打组 %G")] // & alt #shift
static void MakeGroup( )
{
GameObject group = new GameObject("group");
foreach (var e in Selection.gameObjects.Where(e => e.activeInHierarchy))
{
e.transform.parent = group.transform;
}
}
}