subtitle update

This commit is contained in:
2024-04-04 14:59:38 +01:00
parent 61990221d0
commit 37674424a6
2 changed files with 17 additions and 15 deletions

View File

@@ -67,7 +67,6 @@ public class SubtitleManager : MonoBehaviour
offset = Random.Range(5f, 7f);
}
Debug.Log($"offset{offset}, wt{waitTime}");
float earlyOffset = 0;
if (!earlyStop)
@@ -90,21 +89,24 @@ public class SubtitleManager : MonoBehaviour
bool earlyStop = false;
if (Random.Range(0f, 10f) > 6) earlyStop = true;
yield return new WaitForSecondsRealtime(0);
foreach (char c in sentence.ToCharArray())
{
index++;
m_Text.text += c;
float randomInterval = Random.Range(0.001f, 0.002f);
yield return new WaitForSecondsRealtime(randomInterval);
m_TimeElapsed += randomInterval;
m_Text.text = sentence;
// Stop audio early based on probability
if (randomStoppingValue == index && earlyStop)
{
//AudioManager.instance.StopSound(m_NarrationSFXInst);
}
}
//foreach (char c in sentence.ToCharArray())
//{
// index++;
// m_Text.text += c;
// float randomInterval = Random.Range(0, 0f);
// yield return new WaitForSecondsRealtime(randomInterval);
// m_TimeElapsed += randomInterval;
// // Stop audio early based on probability
// if (randomStoppingValue == index && earlyStop)
// {
// //AudioManager.instance.StopSound(m_NarrationSFXInst);
// }
//}
StartCoroutine(ClearText(waitTime, false));
}