IEnumerator DoTick()
{
for (; ; )
{
if (CurrentStep == 1 && OnNewMeasure != null)
OnNewMeasure();
if (OnTick != null)
OnTick();
nextTime += interval;
yield return new WaitForSeconds(nextTime - Time.time);
CurrentStep++;
if (CurrentStep > Step)
{
CurrentStep = 1;
CurrentMeasure++;
}
}
}
}