Browse Source

Null pointer checks in case typing audio is not set

master
chrisgregan 10 years ago
parent
commit
485140c1d1
  1. 18
      Assets/Fungus/Dialog/Scripts/Dialog.cs

18
Assets/Fungus/Dialog/Scripts/Dialog.cs

@ -249,8 +249,12 @@ namespace Fungus
if (!skipCharacter)
{
if (typingAudio != null)
typingAudio.audio.Pause();
yield return new WaitForSeconds(currentPunctuationPause);
if (typingAudio != null)
typingAudio.audio.Play();
}
}
@ -288,8 +292,13 @@ namespace Fungus
{
duration = 1f;
}
if (typingAudio != null)
typingAudio.audio.Pause();
yield return new WaitForSeconds(duration);
if (typingAudio != null)
typingAudio.audio.Play();
timeAccumulator = 0f;
@ -297,9 +306,12 @@ namespace Fungus
case GlyphType.WaitForInputNoClear:
OnWaitForInputTag(true);
if (typingAudio != null)
typingAudio.audio.Pause();
yield return StartCoroutine(WaitForInput(null));
if (typingAudio != null)
typingAudio.audio.Play();
timeAccumulator = 0f;
@ -309,8 +321,12 @@ namespace Fungus
case GlyphType.WaitForInputAndClear:
OnWaitForInputTag(true);
if (typingAudio != null)
typingAudio.audio.Pause();
yield return StartCoroutine(WaitForInput(null));
if (typingAudio != null)
typingAudio.audio.Play();
OnWaitForInputTag(false);

Loading…
Cancel
Save