Beispiel #1
0
        public void AfterChoice(int buttonIndex)
        {
            switch (buttonIndex)
            {
            case 1:
                afterChoiceText.text = branch.FirstChoice.CheckSucces()
                        ? branch.FirstChoice.SuccesAfterAnswer
                        : branch.FirstChoice.FailAfterAnswer;
                branch.FirstChoice.PlayerInteract(branch.FirstChoice.CheckSucces());
                break;

            case 2:
                afterChoiceText.text = branch.SecondChoice.CheckSucces()
                        ? branch.SecondChoice.SuccesAfterAnswer
                        : branch.SecondChoice.FailAfterAnswer;
                branch.SecondChoice.PlayerInteract(branch.SecondChoice.CheckSucces());
                break;

            case 3:
                afterChoiceText.text = branch.ThirdChoice.CheckSucces()
                        ? branch.ThirdChoice.SuccesAfterAnswer
                        : branch.ThirdChoice.FailAfterAnswer;
                branch.ThirdChoice.PlayerInteract(branch.ThirdChoice.CheckSucces());
                break;
            }
            ShowClosePanel.LayoutInteract(ChoicePanel);
            ShowClosePanel.LayoutInteract(AfterChoicePanel);
        }
Beispiel #2
0
        void OnTriggerEnter()
        {
            if (ChoicePanel.active)
            {
                return;
            }
            Debug.Log("Trigger enter (скорее всего всё еще происходит два захода в триггер)");

            if (Key == "UNIVERSITY")
            {
                DateTimeInfo.Instance.IsWentToPairs = true;
            }

            branch = Branches[Key][random.Next(Count)];

            messageText.text = branch.Message;
            firstText.text   = branch.FirstChoice.Answer;
            secondText.text  = branch.SecondChoice.Answer;
            thirdText.text   = branch.ThirdChoice.Answer;
            ShowClosePanel.LayoutInteract(ChoicePanel);
        }