public void StateChange(string name, Decision.State currState) { var elem = list.Find(x => x.name == name); if (elem != null) { elem.GetComponent <DecisionLogic>().OnStateChange(currState); } }
public void OnStateChange(Decision.State currState) { switch (currState) { case Decision.State.PUBLISH_ED: { this.btnPublish.gameObject.SetActive(false); this.btnCancel.gameObject.SetActive(true); this.btnCancel.interactable = false; } break; case Decision.State.CANCEL_ENABLE: { this.btnPublish.gameObject.SetActive(false); this.btnCancel.gameObject.SetActive(true); this.btnCancel.interactable = true; } break; default: break; } }