unity-atoms/Packages/Core/Runtime/Variables/FloatVariable.cs
2019-10-14 16:51:54 +02:00

20 lines
617 B
C#

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