Skip to content

Instantly share code, notes, and snippets.

@iwaken71
Created April 18, 2019 02:58
Show Gist options
  • Save iwaken71/99ffd126acddaa94f1d524bfa14cf7cf to your computer and use it in GitHub Desktop.
Save iwaken71/99ffd126acddaa94f1d524bfa14cf7cf to your computer and use it in GitHub Desktop.
Unityショートカット、選択されたオブジェクトのアクティブの切り替えができる
using UnityEngine;
using UnityEditor;
public class ObjectActiveControllerEditor : MonoBehaviour {
//Ctrl + gキーを押すと実行される 選択されたオブジェクトのオンオフを切り替える
[MenuItem ("ShotCut/SwitchActive %g")]
private static void SwitchActiveOnOff () {
foreach (var item in Selection.transforms)
{
item.gameObject.SetActive(!item.gameObject.activeSelf);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment