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

19 lines
574 B
C#

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