Re: About Dialogue Actor component
Posted: Thu Jun 24, 2021 10:37 am
Then I tried to move CheckActiveCommands() and the code after it to LateUpdate() of sequencer. This time it seems working after I tested several times.
How do you think of this modification? Is it truely solves the problem, is it safe for other commands?
Code: Select all
public void Update()
{
if (m_isPlaying)
{
CheckQueuedCommands();
}
}
private void LateUpdate()
{
if (m_isPlaying)
{
CheckActiveCommands();
if (m_delayTimeLeft > 0)
{
switch (DialogueTime.mode)
{
case DialogueTime.TimeMode.Realtime:
m_delayTimeLeft -= Time.unscaledDeltaTime;
break;
case DialogueTime.TimeMode.Gameplay:
m_delayTimeLeft -= Time.deltaTime;
break;
}
}
if ((m_queuedCommands.Count == 0) && (m_activeCommands.Count == 0) && m_delayTimeLeft <= 0)
{
FinishSequence();
}
}
}