Why StopActive() function in Class Sequencer need wait 0.1s than destroy cammand ?
Posted: Thu Sep 19, 2019 5:43 am
if i wan't play voice with subject's AudioSource, I stop void in OnDestroy to stop voice in before next subtitle (sometimes an other character say something);
But if the same character play voice in two subtitle, A next is B. pre subtitle play A, the next subtitle play B. Beacuse A will wait 0.1s to destoy so that will stop playing voice in B
that is the code
But if the same character play voice in two subtitle, A next is B. pre subtitle play A, the next subtitle play B. Beacuse A will wait 0.1s to destoy so that will stop playing voice in B
that is the code
Code: Select all
public void StopActive()
{
foreach (var command in m_activeCommands)
{
if (command != null)
{
if (!string.IsNullOrEmpty(command.endMessage)) Sequencer.Message(command.endMessage);
Destroy(command, 0.1f);
}
}
m_activeCommands.Clear();
}