script subtitle fix

This commit is contained in:
2024-05-24 16:08:27 +01:00
parent 2112cd1315
commit 494bbb501c
4 changed files with 52 additions and 46 deletions

View File

@@ -59,7 +59,7 @@ public class NarrationManager : MonoBehaviour
// Coroutine for subtitles, when to start the next one after a delay
IEnumerator SubtitleWait()
{
m_SubtitileWaitTime = Random.Range(12.5f, 20f);
m_SubtitileWaitTime = Random.Range(12.5f, 15f);
yield return new WaitForSeconds(m_SubtitileWaitTime);
updateSubtitle();
}

View File

@@ -69,15 +69,21 @@ public class SubtitleManager : MonoBehaviour
private IEnumerator ClearText(float waitTime, bool earlyStop)
{
var offset = (waitTime - m_TimeElapsed) * Random.Range(0.6f, 0.95f);
Debug.Log($"{offset}");
if(offset < 3)
if (offset > 12.5)
{
offset = 10f;
}
if(offset < 5)
{
offset = Random.Range(5f, 7f);
}
float earlyOffset = 0;
if (!earlyStop)
if (earlyStop)
{
earlyOffset = offset / Random.Range(2, 4);
offset -= earlyOffset;
@@ -96,7 +102,7 @@ public class SubtitleManager : MonoBehaviour
var index = 0;
bool earlyStop = false;
if (Random.Range(0f, 10f) > 6) earlyStop = true;
// if (Random.Range(0f, 10f) > 6) earlyStop = true;
yield return new WaitForSecondsRealtime(0);
//m_Text.text = sentence;