unity-atoms/Assets/UnityAtoms/Variables/IntVariable.cs
2018-10-30 20:05:06 +01:00

18 lines
542 B
C#

using UnityEngine;
namespace UnityAtoms
{
[CreateAssetMenu(menuName = "UnityAtoms/Variables/Int")]
public 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);
}
}
}