mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-24 00:58:59 -05:00
18 lines
543 B
C#
18 lines
543 B
C#
using UnityEngine;
|
|
|
|
namespace UnityAtoms
|
|
{
|
|
[CreateAssetMenu(menuName = "Unity Atoms/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);
|
|
}
|
|
}
|
|
} |