2018-10-30 15:05:06 -04:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace UnityAtoms
|
|
|
|
|
{
|
2018-11-25 18:53:46 -05:00
|
|
|
|
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Int", fileName = "IntVariable", order = 0)]
|
|
|
|
|
public class IntVariable : EquatableScriptableObjectVariable<int, IntEvent, IntIntEvent>,
|
|
|
|
|
IWithApplyChange<int, IntEvent, IntIntEvent>
|
2018-10-30 15:05:06 -04:00
|
|
|
|
{
|
|
|
|
|
public bool ApplyChange(int amount)
|
|
|
|
|
{
|
|
|
|
|
return SetValue(Value + amount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool ApplyChange(EquatableScriptableObjectVariable<int, IntEvent, IntIntEvent> amount)
|
|
|
|
|
{
|
|
|
|
|
return SetValue(Value + amount.Value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|