fix/dev-room #5
@@ -144,12 +144,13 @@ public class SubtitleSequencePlayer : MonoBehaviour
|
|||||||
|
|
||||||
float typeTime = 0f;
|
float typeTime = 0f;
|
||||||
int totalChars = line.text.Length;
|
int totalChars = line.text.Length;
|
||||||
|
int visibleChars = 0;
|
||||||
if (typewriterCharsPerSecond > 0f)
|
if (typewriterCharsPerSecond > 0f)
|
||||||
{
|
{
|
||||||
while (m_currentText.Length < totalChars)
|
while (m_currentText.Length < totalChars)
|
||||||
{
|
{
|
||||||
typeTime += Time.deltaTime;
|
typeTime += Time.deltaTime;
|
||||||
int visibleChars = Mathf.Clamp(Mathf.FloorToInt(typeTime * typewriterCharsPerSecond), 0, totalChars);
|
visibleChars = Mathf.Clamp(Mathf.FloorToInt(typeTime * typewriterCharsPerSecond), 0, totalChars);
|
||||||
m_currentText = line.text.Substring(0, visibleChars);
|
m_currentText = line.text.Substring(0, visibleChars);
|
||||||
yield return null;
|
yield return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user