2020-07-11 19:02:52 +00:00
|
|
|
using SlatedGameToolkit.Framework.Graphics.Render;
|
|
|
|
|
|
|
|
namespace SkinnerBox.Utilities.Gameplay
|
|
|
|
{
|
|
|
|
public struct TransitionValue : IPositionInterpolable
|
|
|
|
{
|
|
|
|
private float current;
|
|
|
|
private float value;
|
|
|
|
|
|
|
|
public float Value
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return current;
|
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
|
|
|
this.value = value;
|
|
|
|
}
|
|
|
|
}
|
2020-07-11 22:09:33 +00:00
|
|
|
|
|
|
|
public float DesignatedValue {
|
|
|
|
get {
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
}
|
2020-07-11 19:02:52 +00:00
|
|
|
public void InterpolatePosition(float delta)
|
|
|
|
{
|
|
|
|
this.current += (value - current) * delta;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void HardSet(float value) {
|
|
|
|
current = value;
|
|
|
|
this.value = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|