void OnTriggerStay(Collider other) { if (other.gameObject.tag == "Human" && Input.GetKeyDown("f")) { //Debug.Log(ObjectToToggle + "; " + this.gameObject); togglable.Toggle(); } }
public override void OnInspectorGUI() { DrawDefaultInspector(); ITogglable togglable = (ITogglable)target; if (GUILayout.Button("Toggle")) { togglable.Toggle(); } }