Unity 设置物体显隐快捷键

using UnityEditor;
using UnityEngine;

public class SetGame : Editor
{
[MenuItem(“Tools/设置物体 &~”)]
static void SetGameObject()
{
GameObject[] xxx = Selection.gameObjects;
if (xxx == null) return;
bool isActive = xxx[0].activeInHierarchy;
foreach(var child in xxx)
{
child.SetActive(!isActive);
}
}
}

你可能感兴趣的:(unity,游戏引擎)