public void PruneFramesBeforeTimestamp(float timestamp) { int i = 0; while (i < m_AnimationRecords.Count) { AnimationRecord animRecord = m_AnimationRecords[i]; animRecord.PruneAnimationFramesBeforeTimestamp(timestamp); if (animRecord.animFrames.Count == 0) { // all frames from animation record have been removed, we can remove the record m_AnimationRecords.SwapElements(i, 0); m_AnimationRecords.PopFront(); } else { ++i; } } m_NumActiveAnims = Mathf.Min(m_NumActiveAnims, m_AnimationRecords.Count); }