|
|
@ -34,6 +34,8 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
protected bool wasPointerClicked; |
|
|
|
protected bool wasPointerClicked; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected AudioSource voiceOverAudio; |
|
|
|
|
|
|
|
|
|
|
|
protected virtual void LateUpdate() |
|
|
|
protected virtual void LateUpdate() |
|
|
|
{ |
|
|
|
{ |
|
|
|
wasPointerClicked = false; |
|
|
|
wasPointerClicked = false; |
|
|
@ -210,6 +212,7 @@ namespace Fungus |
|
|
|
OnWaitForInputTag(false); |
|
|
|
OnWaitForInputTag(false); |
|
|
|
currentSpeed = writingSpeed; |
|
|
|
currentSpeed = writingSpeed; |
|
|
|
dialogText.Clear(); |
|
|
|
dialogText.Clear(); |
|
|
|
|
|
|
|
StopVoiceOver(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case TokenType.WaitOnPunctuation: |
|
|
|
case TokenType.WaitOnPunctuation: |
|
|
@ -332,6 +335,24 @@ namespace Fungus |
|
|
|
wasPointerClicked = true; |
|
|
|
wasPointerClicked = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual void PlayVoiceOver(AudioClip voiceOverSound) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (voiceOverAudio == null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
voiceOverAudio = gameObject.AddComponent<AudioSource>(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
voiceOverAudio.clip = voiceOverSound; |
|
|
|
|
|
|
|
voiceOverAudio.Play(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual void StopVoiceOver() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (voiceOverAudio) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Destroy(voiceOverAudio); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|