示例#1
0
        private void ShowNextText()
        {
            _textIndex++;
            int dialogueLength = _dialogueList.Count;

            if (_textIndex >= dialogueLength)
            {
                DoComplete();
                return;
            }

            Dialogue dialogue = _dialogueList[_textIndex];

            _tutorialPanel.ToggleBackgroundMask(true);
            _tutorialPanel.ToggleCharacter(true, dialogue.text, dialogue.animNameToPlay);

            dialogueShown?.Invoke(dialogue.text);

            if (_autoCloseDelay > 0 && _textIndex >= dialogueLength - 1)
            {
                if (_autoCloseIEnumerator != null)
                {
                    StopCoroutine(_autoCloseIEnumerator);
                }

                _autoCloseIEnumerator = AutoCloseCoroutine();
                StartCoroutine(_autoCloseIEnumerator);
            }
        }