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

18 lines
337 B
C#
Raw Normal View History

using UnityEngine;
2020-02-21 22:36:07 +00:00
namespace QSB.Animation
{
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;
}
}
}