|
|
@ -495,6 +495,7 @@ namespace Fungus |
|
|
|
UpdateCloseMarkup(); |
|
|
|
UpdateCloseMarkup(); |
|
|
|
|
|
|
|
|
|
|
|
float timeAccumulator = Time.deltaTime; |
|
|
|
float timeAccumulator = Time.deltaTime; |
|
|
|
|
|
|
|
float invWritingSpeed = 1f / currentWritingSpeed; |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < param.Length + 1; ++i) |
|
|
|
for (int i = 0; i < param.Length + 1; ++i) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -510,6 +511,7 @@ namespace Fungus |
|
|
|
yield return null; |
|
|
|
yield return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//actually grab the next chars |
|
|
|
PartitionString(writeWholeWords, param, i); |
|
|
|
PartitionString(writeWholeWords, param, i); |
|
|
|
ConcatenateString(startText); |
|
|
|
ConcatenateString(startText); |
|
|
|
textAdapter.Text = outputString.ToString(); |
|
|
|
textAdapter.Text = outputString.ToString(); |
|
|
@ -533,13 +535,19 @@ namespace Fungus |
|
|
|
// Delay between characters |
|
|
|
// Delay between characters |
|
|
|
if (currentWritingSpeed > 0f) |
|
|
|
if (currentWritingSpeed > 0f) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (timeAccumulator > 0f) |
|
|
|
timeAccumulator -= invWritingSpeed; |
|
|
|
|
|
|
|
if (timeAccumulator <= 0f) |
|
|
|
{ |
|
|
|
{ |
|
|
|
timeAccumulator -= 1f / currentWritingSpeed; |
|
|
|
if (invWritingSpeed > Time.deltaTime) |
|
|
|
} |
|
|
|
{ |
|
|
|
else |
|
|
|
yield return new WaitForSeconds(invWritingSpeed); |
|
|
|
{ |
|
|
|
timeAccumulator += invWritingSpeed; |
|
|
|
yield return new WaitForSeconds(1f / currentWritingSpeed); |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
yield return null; |
|
|
|
|
|
|
|
timeAccumulator += Time.deltaTime; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|