internal IEnumerator PlayStep(int playingStep) { // uint step; do { //step = ++holder.stepsPlayed; ShowStaticObjects(); holder.PositionCamera(); stepTime = lastTime = deltaTime = 0; animationElements.ForEach((ae) => ae.ResetElement()); while (stepTime < stepLength && playingStep == holder.PlayingStepID) { stepTime += Time.deltaTime * holder.timeScale; deltaTime = stepTime - lastTime; lastTime = stepTime; animationElements.ForEach((ae) => ae.AnimateElement(stepTime)); yield return(0); } animationElements.ForEach((ae) => ae.EndElement()); } while (stepEnd == StepEndAction.Loop && playingStep == holder.PlayingStepID); if (stepEnd == StepEndAction.Next && playingStep == holder.PlayingStepID) { holder.NextStep(); } else { while (stepEnd == StepEndAction.End && playingStep == holder.PlayingStepID) { yield return(0); } } HideStaticObjects(); // step = ++holder.stepsPlayed; }