private void Lerp(float past, ref float value,float start, float end) { value = Raymath.Lerp(start,end, past); }
//runs in the update functionfloat useless = 0;property.Lerp(time,ref useless);//public Tween SetProperty(float value, float time, float delay, float start, float end){ TweenProperty property = new TweenProperty(time, delay); property.OnLerp += (float past, ref float f) => Lerp(past,ref value,start,end); tweenElements.Add(property); return this;} public class TweenProperty(float time, float delay, Action<float> action = default) { public readonly float Delay = delay; public readonly float Time = time; public Action<float>? Action = action; internal event Property OnLerp; public void Lerp(float past,ref float value) { OnLerp?.Invoke(past, ref value); } }
public int test;//in the constructortween.SetProperty(test, 10, 0, 5, 10);//runs in the update functionLogger.Warn(test+"");//output[Test.RainbowButton:78][21:42] [WARN]: 0
value