|
|
@ -13,10 +13,9 @@ using System.Text; |
|
|
|
|
|
|
|
|
|
|
|
namespace Fungus |
|
|
|
namespace Fungus |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/** |
|
|
|
/// Implement this interface to be notified about Writer events. |
|
|
|
* Implement this interface to be notified about Writer events |
|
|
|
/// </summary> |
|
|
|
*/ |
|
|
|
|
|
|
|
public interface IWriterListener |
|
|
|
public interface IWriterListener |
|
|
|
{ |
|
|
|
{ |
|
|
|
/// |
|
|
|
/// |
|
|
@ -42,6 +41,9 @@ namespace Fungus |
|
|
|
void OnGlyph(); |
|
|
|
void OnGlyph(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
|
|
/// Writes text using a typewriter effect to a UI text object. |
|
|
|
|
|
|
|
/// </summary> |
|
|
|
public class Writer : MonoBehaviour, IDialogInputListener |
|
|
|
public class Writer : MonoBehaviour, IDialogInputListener |
|
|
|
{ |
|
|
|
{ |
|
|
|
[Tooltip("Gameobject containing a Text, Inout Field or Text Mesh object to write to")] |
|
|
|
[Tooltip("Gameobject containing a Text, Inout Field or Text Mesh object to write to")] |
|
|
@ -70,12 +72,10 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
// This property is true when the writer is waiting for user input to continue |
|
|
|
// This property is true when the writer is waiting for user input to continue |
|
|
|
protected bool isWaitingForInput; |
|
|
|
protected bool isWaitingForInput; |
|
|
|
|
|
|
|
|
|
|
|
public bool IsWaitingForInput { get { return isWaitingForInput; } } |
|
|
|
public bool IsWaitingForInput { get { return isWaitingForInput; } } |
|
|
|
|
|
|
|
|
|
|
|
// This property is true when the writer is writing text or waiting (i.e. still processing tokens) |
|
|
|
// This property is true when the writer is writing text or waiting (i.e. still processing tokens) |
|
|
|
protected bool isWriting; |
|
|
|
protected bool isWriting; |
|
|
|
|
|
|
|
|
|
|
|
public bool IsWriting { get { return isWriting; } } |
|
|
|
public bool IsWriting { get { return isWriting; } } |
|
|
|
|
|
|
|
|
|
|
|
protected float currentWritingSpeed; |
|
|
|
protected float currentWritingSpeed; |
|
|
|