Neodroid  0.2.0
Machine Learning Environment Prototyping Tool
KeyEventEnabler.cs
Go to the documentation of this file.
2 using UnityEngine;
3 
4 namespace droid.Runtime.InternalReactions {
8  public class KeyEventEnabler : MonoBehaviour {
9  [SerializeField] GameObject _game_object = null;
10 
11  [SerializeField] [SearchableEnum] KeyCode _key = KeyCode.None;
12 
15  void Update() {
16  if (Input.GetKeyDown(this._key)) {
17  this._game_object?.SetActive(!this._game_object.activeSelf);
18  }
19  }
20  }
21 }