// Color lerp public void Lerp(Color start, Color end, float speed = 1f, AnimationCurve curve = null) { LerpingType = LerpingObject.Color; StartColor = start; EndColor = end; Speed = speed; if (curve != null) { Curve = curve; } Lerp(); }
// Position or Scale lerp public void Lerp(Vector3 start, Vector3 end, float speed = 1f, bool isTransformLerp = true, AnimationCurve curve = null) { if (isTransformLerp) { LerpingType = LerpingObject.Transform; StartPosition = start; EndPosition = end; } else { LerpingType = LerpingObject.Scale; StartScale = start; EndScale = end; } Speed = speed; if (curve != null) { Curve = curve; } Lerp(); }