unity-atoms/Assets/UnityAtoms/Variables/IntVariable.cs

18 lines
542 B
C#
Raw Normal View History

2018-10-30 15:05:06 -04:00
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);
}
}
}