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

18 lines
344 B
C#
Raw Normal View History

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