mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-23 16:48:23 -05:00
19 lines
588 B
C#
19 lines
588 B
C#
using UnityEngine;
|
|
|
|
namespace UnityAtoms
|
|
{
|
|
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Int", fileName = "IntVariable", order = 0)]
|
|
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);
|
|
}
|
|
}
|
|
} |