void Toggle(bool t) { if (toggleScript) { toggleScript.Toggle(t); } else { throw new System.Exception(toggleableObject.name + " does not have Toggleable script attached."); } }
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"); }
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); }