Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static bool InRange(this float current, float min, float max) => current >= min && current <= max;
- public static bool InRange(this int current, float min, float max) => current >= min && current <= max;
- public static RangeFloat AsRange(this float max) => new(0f, max);
- public static RangeFloat AsRange(this float min, float max) => new(min, max);
- public static RangeInt AsRange(this int max) => new(0, max);
- public static RangeInt AsRange(this int min, int max) => new(min, max);
- public static Keyframe First(this AnimationCurve curve) => curve[0];
- public static Keyframe Last(this AnimationCurve curve) => curve[curve.length - 1];
- public static bool InRange(this AnimationCurve curve, float time)
- {
- if (curve == null || curve.length == 0 )
- return false;
- Keyframe first = curve.First();
- Keyframe last = curve.Last();
- return time.InRange(first.time, last.time);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement