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

20 lines
585 B
C#

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