コード例 #1
0
 void OnTriggerStay(Collider other)
 {
     if (other.gameObject.tag == "Human" && Input.GetKeyDown("f"))
     {
         //Debug.Log(ObjectToToggle + "; " + this.gameObject);
         togglable.Toggle();
     }
 }
コード例 #2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        ITogglable togglable = (ITogglable)target;

        if (GUILayout.Button("Toggle"))
        {
            togglable.Toggle();
        }
    }