/// <summary> /// Show branch buttons when branch happens /// </summary> /// <param name="branchOccursEventData"></param> public void OnBranchHappen(BranchOccursEventData branchOccursEventData) { var branchInformations = branchOccursEventData.branchInformations; foreach (var branchInformation in branchInformations) { var childButtom = Instantiate(branchButtomPrefab); childButtom.transform.SetParent(transform); var text = childButtom.GetComponent <Text>(); if (text == null) { text = childButtom.GetComponentInChildren <Text>(); } text.text = branchInformation.name; childButtom.onClick.AddListener(() => Select(branchInformation.name)); } }
/// <summary> /// Make the state normal when branch occurs /// </summary> /// <param name="branchOccursEventData"></param> private void OnBranchOcurrs(BranchOccursEventData branchOccursEventData) { stateBeforeBranch = State; State = DialogueBoxState.Normal; }