unity-atoms/Packages/Core/Runtime/Variables/FloatVariable.cs

19 lines
582 B
C#
Raw Normal View History

2018-10-30 15:05:06 -04:00
using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Float", fileName = "FloatVariable")]
public sealed class FloatVariable : EquatableAtomVariable<float, FloatEvent, FloatFloatEvent>, IWithApplyChange<float, FloatEvent, FloatFloatEvent>
2018-10-30 15:05:06 -04:00
{
public bool ApplyChange(float amount)
{
return SetValue(Value + amount);
}
public bool ApplyChange(EquatableAtomVariable<float, FloatEvent, FloatFloatEvent> amount)
2018-10-30 15:05:06 -04:00
{
return SetValue(Value + amount.Value);
}
}
}