|
|
|
@ -12,6 +12,23 @@ using Fungus.Utils;
|
|
|
|
|
|
|
|
|
|
namespace Fungus |
|
|
|
|
{ |
|
|
|
|
/// <summary> |
|
|
|
|
/// Current state of the writing process. |
|
|
|
|
/// </summary> |
|
|
|
|
public enum WriterState |
|
|
|
|
{ |
|
|
|
|
/// <summary> Invalid state. </summary> |
|
|
|
|
Invalid, |
|
|
|
|
/// <summary> Writer has started writing. </summary> |
|
|
|
|
Start, |
|
|
|
|
/// <summary> Writing has been paused. </summary> |
|
|
|
|
Pause, |
|
|
|
|
/// <summary> Writing has resumed after a pause. </summary> |
|
|
|
|
Resume, |
|
|
|
|
/// <summary> Writing has ended. </summary> |
|
|
|
|
End |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Writes text using a typewriter effect to a UI text object. |
|
|
|
|
/// </summary> |
|
|
|
@ -677,6 +694,8 @@ namespace Fungus
|
|
|
|
|
|
|
|
|
|
protected virtual void NotifyStart(AudioClip audioClip) |
|
|
|
|
{ |
|
|
|
|
WriterSignals.DoWriterState(this, WriterState.Start); |
|
|
|
|
|
|
|
|
|
foreach (IWriterListener writerListener in writerListeners) |
|
|
|
|
{ |
|
|
|
|
writerListener.OnStart(audioClip); |
|
|
|
@ -685,6 +704,8 @@ namespace Fungus
|
|
|
|
|
|
|
|
|
|
protected virtual void NotifyPause() |
|
|
|
|
{ |
|
|
|
|
WriterSignals.DoWriterState(this, WriterState.Pause); |
|
|
|
|
|
|
|
|
|
foreach (IWriterListener writerListener in writerListeners) |
|
|
|
|
{ |
|
|
|
|
writerListener.OnPause(); |
|
|
|
@ -693,6 +714,8 @@ namespace Fungus
|
|
|
|
|
|
|
|
|
|
protected virtual void NotifyResume() |
|
|
|
|
{ |
|
|
|
|
WriterSignals.DoWriterState(this, WriterState.Resume); |
|
|
|
|
|
|
|
|
|
foreach (IWriterListener writerListener in writerListeners) |
|
|
|
|
{ |
|
|
|
|
writerListener.OnResume(); |
|
|
|
@ -701,6 +724,8 @@ namespace Fungus
|
|
|
|
|
|
|
|
|
|
protected virtual void NotifyEnd(bool stopAudio) |
|
|
|
|
{ |
|
|
|
|
WriterSignals.DoWriterState(this, WriterState.End); |
|
|
|
|
|
|
|
|
|
foreach (IWriterListener writerListener in writerListeners) |
|
|
|
|
{ |
|
|
|
|
writerListener.OnEnd(stopAudio); |
|
|
|
|