using UnityEngine; public class TweenCurve : ScriptableObject { public AnimationCurve curve = AnimationCurve.EaseInOut(0, 0, 1, 1); Keyframe[] m_Keys; public Keyframe[] keys { get { return m_Keys ?? (m_Keys = curve.keys); } } public int length { get { return curve.length; } } float m_TotalTime = -1f; public float totalTime { get { if (m_TotalTime < 0f) { m_TotalTime = curve.keys[curve.keys.Length - 1].time - curve.keys[0].time; } return m_TotalTime; } } public Keyframe this[int index] { get { return curve[index]; } } public float Evaluate(float time) { float aaa = curve.Evaluate(time); return aaa; } }