unity-atoms/Source/Variables/FloatVariable.cs
2019-05-29 18:56:26 +02:00

19 lines
606 B
C#

using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Float", fileName = "FloatVariable")]
public sealed class FloatVariable : EquatableScriptableObjectVariable<float, FloatEvent, FloatFloatEvent>, IWithApplyChange<float, FloatEvent, FloatFloatEvent>
{
public bool ApplyChange(float amount)
{
return SetValue(Value + amount);
}
public bool ApplyChange(EquatableScriptableObjectVariable<float, FloatEvent, FloatFloatEvent> amount)
{
return SetValue(Value + amount.Value);
}
}
}