public void TestAnimationEndTime() { AnimationCurve curve = new AnimationCurve(); curve.keys = new Keyframe[] { new Keyframe(0f, 3f), new Keyframe(0.5f, 2f), new Keyframe(2.3f, 6f) }; Assert.IsTrue(TestUtils.Approx(curve.EndTime(), 2.3f)); }
/// <summary> /// The difference in time between the last point and the first point in the curve /// </summary> public static float Duration(this AnimationCurve curve) { return(curve.EndTime() - curve.StartTime()); }