mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-24 09:08:23 -05:00
18 lines
569 B
C#
18 lines
569 B
C#
using UnityEngine;
|
|
|
|
namespace UnityAtoms
|
|
{
|
|
[CreateAssetMenu(menuName = "UnityAtoms/Variables/Float")]
|
|
public class FloatVariable : EquatableScriptableObjectVariable<float, FloatEvent, FloatFloatEvent>, IWithApplyChange<float, FloatEvent, FloatFloatEvent>
|
|
{
|
|
public bool ApplyChange(float amount)
|
|
{
|
|
return SetValue(Value + amount);
|
|
}
|
|
|
|
public bool ApplyChange(EquatableScriptableObjectVariable<float, FloatEvent, FloatFloatEvent> amount)
|
|
{
|
|
return SetValue(Value + amount.Value);
|
|
}
|
|
}
|
|
} |