public void ReloadRepeat(float m_reloadTime, int m_repeat) { float TotalTime = Anim[StartReloadAnim].clip.length + (Anim[InsertAnim].clip.length * m_repeat) + Anim[AfterReloadAnim].clip.length; AnimationState firtsState = Anim.CrossFadeQueued(StartReloadAnim); firtsState.speed = (TotalTime / m_reloadTime) / 1.4f; for (int i = 0; i < m_repeat; i++) { AnimationState newReload2 = Anim.CrossFadeQueued(InsertAnim); newReload2.speed = (TotalTime / m_reloadTime) / 1.4f; } AnimationState newReload3 = Anim.CrossFadeQueued(AfterReloadAnim); if (m_repeat > 1) { newReload3.speed = (TotalTime / m_reloadTime) / 1.4f; } else { newReload3.speed = (TotalTime / m_reloadTime) / 2; } }