quantum-space-buddies/QSB/Animation/Player/AnimFloatParam.cs

17 lines
331 B
C#
Raw Normal View History

using UnityEngine;
2022-03-03 03:46:33 +00:00
namespace QSB.Animation.Player;
public class AnimFloatParam
{
2022-03-03 03:46:33 +00:00
public float Current { get; private set; }
public float Target { get; set; }
2022-03-03 03:46:33 +00:00
private float _velocity;
2022-03-03 03:46:33 +00:00
public float Smooth(float smoothTime)
{
Current = Mathf.SmoothDamp(Current, Target, ref _velocity, smoothTime);
return Current;
2020-12-02 21:23:01 +00:00
}
}