private void OnRightKeyClicked(Image image, MouseButton button) { if (button == MouseButton.Left && Curve != null) { var time = Timeline.CurrentTime; var keyframes = Curve.GetKeyframes(); for (int i = 0; i < keyframes.Length; i++) { var k = keyframes[i]; if (k.Time > time) { Timeline.OnSeek(Mathf.FloorToInt(k.Time * Timeline.FramesPerSecond)); break; } } } }
/// <inheritdoc /> public override bool GetNextKeyframeFrame(float time, out int result) { if (Curve != null) { var keyframes = Curve.GetKeyframes(); for (int i = 0; i < keyframes.Length; i++) { var k = keyframes[i]; if (k.Time > time) { result = Mathf.FloorToInt(k.Time * Timeline.FramesPerSecond); return(true); } } } return(base.GetNextKeyframeFrame(time, out result)); }