IEnumerator Animate(Scd_Data data) { float rate = data.rate; float start_time = Time.time; bool animate = true; while (animate) { // this only works since we're yielding inside of the loop and this is a coroutine. float time_passed = Mathf.Abs(Time.time - start_time); int frame = Mathf.CeilToInt(rate * time_passed); if (frame > data.frames.Length) { break; } foreach (Scd_Frame_Group group in data.frames[frame].groups) { ProcessGroupAnimation(group, data.flags); } yield return(null); } }
internal void PlayAnimation(Scd_Data data) { // TODO: Write queue animations to be played. }
IEnumerator Animate(Scd_Data data) { float rate = data.rate; float start_time = Time.time; bool animate = true; while (animate) { // this only works since we're yielding inside of the loop and this is a coroutine. float time_passed = Mathf.Abs(Time.time - start_time); int frame = Mathf.CeilToInt(rate * time_passed); if (frame > data.frames.Length) break; foreach (Scd_Frame_Group group in data.frames[frame].groups) { ProcessGroupAnimation(group, data.flags); } yield return null; } }
internal void PlayAnimation(Scd_Data data) { // TODO: Write queue animations to be played. }