コード例 #1
0
    private IEnumerator IterateDialogueList()
    {
        while (_dialogueElementsList.Count != 0)
        {
            DialogueElement dialogueElement = _dialogueElementsList[0];
            //Debug.Log("Now playing: " + dialogueElement.voFile.name+" from queue");
            _currentDialogueElement = dialogueElement;
            if (_currentDialogueElement.triggerEventWithDelayFromStart)
            {
                _currentDialogueElement.SetStarted(true);
            }
            audioManager.PlaySound(dialogueElement.voFile);
            if (subtitlesActive)
            {
                StartCoroutine(subtitles.ConvertAndDisplaySubtitles(dialogueElement.subtitleText));
            }
            yield return(new WaitForSeconds(dialogueElement.voFile.source.clip.length + timeBetweenQueuedVo));

            if (_currentDialogueElement.triggerEventAtEnd)
            {
                _currentDialogueElement.SetEnded(true);
            }
            if (_dialogueElementsList.Count > 0)
            {
                try
                {
                    _dialogueElementsList.RemoveAt(0);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    throw;
                }
            }
        }
        _queueIsRunning = false;
        yield return(null);
    }
コード例 #2
0
 private void Awake()
 {
     dialogueElement.SetStarted(false);
     dialogueElement.SetEnded(false);
 }