Small bug prevented text from showing without sound
This commit is contained in:
Gerard Gascón 2022-09-15 17:43:49 +02:00 committed by GitHub
parent 9f9dedba98
commit 505584b91e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 5 deletions

View file

@ -28,12 +28,11 @@ namespace SimpleTools.DialogueSystem {
}
public bool Dialogue(Dialogue dialogue) {
return Dialogue(dialogue, "");
return Dialogue(dialogue, string.Empty);
}
public bool Dialogue(Dialogue dialogue, params string[] sounds) {
if (sounds != null)
dialogueVertexAnimator.SetAudioSourceGroup(sounds);
dialogueVertexAnimator.SetAudioSourceGroup(sounds);
if (!talking) {
sentences.Clear();

View file

@ -216,7 +216,7 @@ namespace SimpleTools.DialogueSystem {
if (Time.unscaledTime - lastDialogueSound > timeUntilNextDialogueSound) {
timeUntilNextDialogueSound = UnityEngine.Random.Range(0.02f, 0.08f);
lastDialogueSound = Time.unscaledTime;
if (audioSourceGroup != null)
if (audioSourceGroup[0] != string.Empty)
AudioManager.AudioManager.instance.PlayRandomSound(audioSourceGroup);
}
}