subtitle update
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user