public IEnumerator PlayVoiceLine() { getLanguage(); if (isGerman) { _hudCanvas.setDialog(_soundContainer.soundScenes[_soundScene].soundEvents[_randomSound].soundLines[_dialogCounter].subtileGer, _soundContainer.soundScenes[_soundScene].soundEvents[_randomSound].soundLines[_dialogCounter].role); } else { _hudCanvas.setDialog(_soundContainer.soundScenes[_soundScene].soundEvents[_randomSound].soundLines[_dialogCounter].subtileEng, _soundContainer.soundScenes[_soundScene].soundEvents[_randomSound].soundLines[_dialogCounter].role); } PlayDialogue(_soundContainer.soundScenes[_soundScene].soundEvents[_randomSound].soundLines[_dialogCounter].lineID, _soundContainer.soundScenes[_soundScene].soundEvents[_randomSound].soundLines[_dialogCounter].role); if (_dialogCounter == 0) { _hudCanvas.EnableDialog(); } yield return(new WaitForSeconds(_soundContainer.soundScenes[_soundScene].soundEvents[_randomSound].soundLines[_dialogCounter].lineAudio.length + _soundContainer.soundScenes[_soundScene].soundEvents[_randomSound].soundLines[_dialogCounter].waitTimeInMS / 1000)); if (_soundContainer.soundScenes[_soundScene].soundEvents[_randomSound].soundLines[_dialogCounter].nextLineID == "End") { StartCoroutine(Cooldown()); } else { _dialogCounter++; StartCoroutine(PlayVoiceLine()); } }
private void EstellaAppears() { Debug.Log("estella just arrived"); getLanguage(); estellaAppeared = true; if (isGerman) { _hudCanvas.setDialog(_soundContainer.soundScenes[0].soundEvents[0].soundLines[0].subtileGer, _soundContainer.soundScenes[0].soundEvents[0].soundLines[0].role); } else { _hudCanvas.setDialog(_soundContainer.soundScenes[0].soundEvents[0].soundLines[0].subtileEng, _soundContainer.soundScenes[0].soundEvents[0].soundLines[0].role); } PlayDialogue(_soundContainer.soundScenes[0].soundEvents[0].soundLines[dialogCounter].lineID, _soundContainer.soundScenes[0].soundEvents[0].soundLines[dialogCounter].role); _hudCanvas.EnableDialog(); Invoke("VoicelineHasEnded", _soundContainer.soundScenes[0].soundEvents[0].soundLines[0].lineAudio.length); }