Created
April 18, 2019 02:58
-
-
Save iwaken71/99ffd126acddaa94f1d524bfa14cf7cf to your computer and use it in GitHub Desktop.
Unityショートカット、選択されたオブジェクトのアクティブの切り替えができる
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 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