private void ValueChange() { //if(ScaleRef.Value < 20) //{ // tween?.Complete(); // tween = transform.DOPunchScale(Vector3.one * ScaleRef.Value.Clamp(0.5f, 20), ScaleSpeed, 7); // tween.onComplete -= OnComplete; // tween.onComplete += OnComplete; //} //else { tween?.Complete(); tween = transform.DOScale(Vector3.one * ScaleRef.Value.Clamp(0.5f, 20), 1); } WorldSettings.GameRadius = Lerps.Lerp(35f, 60f, ScaleRef.Value.Clamp(0, 2)); }
public static float Lerp(this float start, float end, float time, bool clamp = false) => Lerps.Lerp(start, end, time, clamp);