控制所选层级面板物体的激活状态
public class GameObjectControl
{
//控制当前选择对象的显示 alt + f
[MenuItem("Toolkit/GameObject/Active GameObject &f")]
public static void ActiveGameObject()
{
GameObject[] objs = Selection.gameObjects;
if (objs.Length == 0) return;
bool isActive = !objs[0].activeSelf;
for (int i = 0; i < objs.Length; i++)
{
objs[i].SetActive(isActive);
}
}
}