|
|
@ -64,6 +64,7 @@ namespace Fungus |
|
|
|
protected bool colorActive = false; |
|
|
|
protected bool colorActive = false; |
|
|
|
protected string colorText = ""; |
|
|
|
protected string colorText = ""; |
|
|
|
protected bool inputFlag; |
|
|
|
protected bool inputFlag; |
|
|
|
|
|
|
|
protected bool exitFlag; |
|
|
|
|
|
|
|
|
|
|
|
protected List<IWriterListener> writerListeners = new List<IWriterListener>(); |
|
|
|
protected List<IWriterListener> writerListeners = new List<IWriterListener>(); |
|
|
|
|
|
|
|
|
|
|
@ -237,7 +238,12 @@ namespace Fungus |
|
|
|
textMesh.color = tempColor; |
|
|
|
textMesh.color = tempColor; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual void Stop() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
exitFlag = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public virtual void Write(string content, bool clear, bool waitForInput, AudioClip audioClip, Action onComplete) |
|
|
|
public virtual void Write(string content, bool clear, bool waitForInput, AudioClip audioClip, Action onComplete) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (clear) |
|
|
|
if (clear) |
|
|
@ -275,11 +281,11 @@ namespace Fungus |
|
|
|
currentPunctuationPause = punctuationPause; |
|
|
|
currentPunctuationPause = punctuationPause; |
|
|
|
currentWritingSpeed = writingSpeed; |
|
|
|
currentWritingSpeed = writingSpeed; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exitFlag = false; |
|
|
|
isWriting = true; |
|
|
|
isWriting = true; |
|
|
|
|
|
|
|
|
|
|
|
foreach (TextTagParser.Token token in tokens) |
|
|
|
foreach (TextTagParser.Token token in tokens) |
|
|
|
{ |
|
|
|
{ |
|
|
|
bool exit = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (token.type) |
|
|
|
switch (token.type) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -351,7 +357,7 @@ namespace Fungus |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case TextTagParser.TokenType.Exit: |
|
|
|
case TextTagParser.TokenType.Exit: |
|
|
|
exit = true; |
|
|
|
exitFlag = true; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case TextTagParser.TokenType.Message: |
|
|
|
case TextTagParser.TokenType.Message: |
|
|
@ -436,13 +442,14 @@ namespace Fungus |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (exit) |
|
|
|
if (exitFlag) |
|
|
|
{ |
|
|
|
{ |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
inputFlag = false; |
|
|
|
inputFlag = false; |
|
|
|
|
|
|
|
exitFlag = false; |
|
|
|
isWriting = false; |
|
|
|
isWriting = false; |
|
|
|
|
|
|
|
|
|
|
|
NotifyEnd(); |
|
|
|
NotifyEnd(); |
|
|
@ -463,6 +470,12 @@ namespace Fungus |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < param.Length; ++i) |
|
|
|
for (int i = 0; i < param.Length; ++i) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
// Exit immediately if the exit flag has been set |
|
|
|
|
|
|
|
if (exitFlag) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
string left = ""; |
|
|
|
string left = ""; |
|
|
|
string right = ""; |
|
|
|
string right = ""; |
|
|
|
|
|
|
|
|
|
|
|