public IEnumerator Cooldown() { _hudCanvas.DisableDialog(); _voiceLineCooldown = Random.Range(minimumSoundWaitTimeInSeconds, maximumSoundWaitTimeInSeconds); yield return(new WaitForSeconds(_voiceLineCooldown)); pickRandomSound(); }
//Delegate event that is thrown, when the SoundContainer is empty again public void VoicelineHasEnded() { getLanguage(); if (!defenseWasUsed) { if (timotheAppeared && estellaAppeared && firstDummyDestroyed) { dialogCounter++; //Invoke("FirstDummyWasDestroyed", 2); if (dialogCounter < _soundContainer.soundScenes[0].soundEvents[2].soundLines.Count) { if (isGerman) { _hudCanvas.setDialog(_soundContainer.soundScenes[0].soundEvents[2].soundLines[dialogCounter].subtileGer, _soundContainer.soundScenes[0].soundEvents[2].soundLines[dialogCounter].role); } else { _hudCanvas.setDialog(_soundContainer.soundScenes[0].soundEvents[2].soundLines[dialogCounter].subtileEng, _soundContainer.soundScenes[0].soundEvents[2].soundLines[dialogCounter].role); } PlayDialogue(_soundContainer.soundScenes[0].soundEvents[2].soundLines[dialogCounter].lineID, _soundContainer.soundScenes[0].soundEvents[2].soundLines[dialogCounter].role); Invoke("VoicelineHasEnded", _soundContainer.soundScenes[0].soundEvents[2].soundLines[dialogCounter].lineAudio.length + _soundContainer.soundScenes[0].soundEvents[2].soundLines[dialogCounter].waitTimeInMS / 1000); } else { _hudCanvas.DisableDialog(); isDummyDialogOver = true; } //Invoke("DefenseWasUsed", 2); return; } else if (timotheAppeared && estellaAppeared) { dialogCounter++; //Invoke("FirstDummyWasDestroyed", 2); if (dialogCounter < _soundContainer.soundScenes[0].soundEvents[1].soundLines.Count) { if (isGerman) { _hudCanvas.setDialog(_soundContainer.soundScenes[0].soundEvents[1].soundLines[dialogCounter].subtileGer, _soundContainer.soundScenes[0].soundEvents[1].soundLines[dialogCounter].role); } else { _hudCanvas.setDialog(_soundContainer.soundScenes[0].soundEvents[1].soundLines[dialogCounter].subtileEng, _soundContainer.soundScenes[0].soundEvents[1].soundLines[dialogCounter].role); } PlayDialogue(_soundContainer.soundScenes[0].soundEvents[1].soundLines[dialogCounter].lineID, _soundContainer.soundScenes[0].soundEvents[1].soundLines[dialogCounter].role); Invoke("VoicelineHasEnded", _soundContainer.soundScenes[0].soundEvents[1].soundLines[dialogCounter].lineAudio.length + _soundContainer.soundScenes[0].soundEvents[1].soundLines[dialogCounter].waitTimeInMS / 1000); } else { _hudCanvas.DisableDialog(); spawnDummies(); } return; } else if (estellaAppeared) { _hudCanvas.DisableDialog(); Invoke("TimotheAppears", 2); timothe.GetComponent <TimothyMovementTrigger>().TriggerMovement(); return; } } else { dialogCounter++; //Invoke("FirstDummyWasDestroyed", 2); if (dialogCounter < _soundContainer.soundScenes[0].soundEvents[3].soundLines.Count) { if (isGerman) { _hudCanvas.setDialog(_soundContainer.soundScenes[0].soundEvents[3].soundLines[dialogCounter].subtileGer, _soundContainer.soundScenes[0].soundEvents[3].soundLines[dialogCounter].role); } else { _hudCanvas.setDialog(_soundContainer.soundScenes[0].soundEvents[3].soundLines[dialogCounter].subtileEng, _soundContainer.soundScenes[0].soundEvents[3].soundLines[dialogCounter].role); } PlayDialogue(_soundContainer.soundScenes[0].soundEvents[3].soundLines[dialogCounter].lineID, _soundContainer.soundScenes[0].soundEvents[3].soundLines[dialogCounter].role); Invoke("VoicelineHasEnded", _soundContainer.soundScenes[0].soundEvents[3].soundLines[dialogCounter].lineAudio.length + _soundContainer.soundScenes[0].soundEvents[3].soundLines[dialogCounter].waitTimeInMS / 1000); } else { _hudCanvas.DisableDialog(); portal.SetActive(true); } } }