public static void ShowDecision(int index) { _currentDecision = index; LoadDecisions(); var decision = _decisionScene.decisions[_currentDecision]; var options = decision.options; GameObject.FindGameObjectWithTag(_decisionName).transform.localScale = new Vector3(1, 1, 1); VisualNovelMenu.CanClickNext = false; var counter = 0; while (counter < options.Count) { var optionData = options[counter]; var optionButton = _optionButtons[counter]; var textTag = $"{optionButton.TextTag}_{_optionButtons.Count}"; GameObject.FindGameObjectWithTag(textTag).GetComponent <Text>().text = optionData.key; var buttonTag = $"{optionButton.ButtonTag}_{_optionButtons.Count}"; GameObject.FindGameObjectWithTag(buttonTag).GetComponent <Button>().onClick.AddListener(() => { OptionExecutor.Execute(optionData.action); VisualNovelMenu.CanClickNext = true; HideDecision(); }); counter++; } UpdateDecisionIndex(); Service.Save(_currentDecision); }
protected override void Execute() { OptionExecutor.Execute(_option); }