示例#1
0
 void Toggle(bool t)
 {
     if (toggleScript)
     {
         toggleScript.Toggle(t);
     }
     else
     {
         throw new System.Exception(toggleableObject.name + " does not have Toggleable script attached.");
     }
 }
示例#2
0
 public override void Interact(GameObject player)
 {
     toggle = !toggle;
     if (toggleScript)
     {
         toggleScript.Toggle(toggle);
     }
     else
     {
         throw new System.Exception(toggleableObject.name + " does not have Toggleable script attached.");
     }
     transform.GetChild(0).GetComponent <Animator>().SetTrigger("ToggleLever");
 }
示例#3
0
 private void OnMenuToggle()
 {
     if (!Toggleable.IsToggleQueued(ToggleIdx))
     {
         if (IsEnabled)
         {
             Trigger(2108245096, "BuildingDisabled");
         }
         Prioritizable.AddRef(base.gameObject);
     }
     else
     {
         Prioritizable.RemoveRef(base.gameObject);
     }
     Toggleable.Toggle(ToggleIdx);
     Game.Instance.userMenu.Refresh(base.gameObject);
 }