public override void OnGUI(Rect rect) { GUILayout.BeginArea(rect); GUILayout.Label("Animation Curve Generator", EditorStyles.boldLabel); easeFunction = (EaseFunction)EditorGUILayout.EnumPopup("Ease Function", easeFunction); easeType = (EaseType)EditorGUILayout.EnumPopup("Ease Type", easeType); keyFrames = Mathf.Clamp(EditorGUILayout.IntField("Key Frames", keyFrames), 4, 100); invert = EditorGUILayout.ToggleLeft("Invert", invert); if (GUILayout.Button("Generate")) { AnimationCurveEditorExtension.Apply(EiEase.GetAnimationCurve(EiEase.GetEaseFunction(easeFunction, easeType), keyFrames, invert)); } GUILayout.EndArea(); }
public static float EaseInOut(this float time, EaseFunction functionType) { return(EiEase.GetEaseFunction(functionType, EaseType.InOut) (time)); }
public static float Ease(this float time, EaseFunction functionType, EaseType easeType) { return(EiEase.GetEaseFunction(functionType, easeType) (time)); }