Exemple #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);
            }
        }
 protected virtual void SetupBackgroundMask()
 {
     tutorialPanel.ToggleBackgroundMask(showBackgroundMask, alpha);
     if (clickToComplete)
     {
         Button backgroundButton = tutorialPanel.GetBackgroundButton();
         if (backgroundButton != null)
         {
             backgroundButton.onClick.AddListener(DoComplete);
             if (timeBeforeClickable != 0)
             {
                 backgroundButton.interactable = false;
                 IEnumerator setButtonInteractableCoroutine = SetBackgroundButtonInteractableDelayed(backgroundButton, timeBeforeClickable);
                 StartCoroutine(setButtonInteractableCoroutine);
             }
         }
     }
 }