2020-02-19 11:57:16 +00:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
2022-03-03 03:46:33 +00:00
|
|
|
|
namespace QSB.Animation.Player;
|
|
|
|
|
|
|
|
|
|
public class AnimFloatParam
|
2020-02-19 11:57:16 +00:00
|
|
|
|
{
|
2022-03-03 03:46:33 +00:00
|
|
|
|
public float Current { get; private set; }
|
|
|
|
|
public float Target { get; set; }
|
2020-02-19 11:57:16 +00:00
|
|
|
|
|
2022-03-03 03:46:33 +00:00
|
|
|
|
private float _velocity;
|
2020-02-19 11:57:16 +00:00
|
|
|
|
|
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
|
|
|
|
}
|
2020-02-19 11:57:16 +00:00
|
|
|
|
}
|