public void UpdateSpawn() { if (Spawn == null) { return; } HitboxKeyframe frame = Keyframes.FindLast(h => h.Time < SeekTime); for (var i = 0; i < IDs.Count; i++) { Hitbox hitbox = GetHitbox(IDs[i]); if (hitbox == null) { continue; } hitbox.CurrentType = frame != null ? frame.States[i] : hitbox.DefaultType; } SceneView.RepaintAll(); }
/// <summary> Gets the previous keyframe before a certain time. Returns null if no such keyframe exists. </summary> /// <param name="time"> the time to search from </param> /// <returns> the first keyframe before said time. </returns> public HitboxKeyframe PrevKeyframe(float time) { return(Keyframes.FindLast(kf => kf.Time < time)); }