2018-10-30 20:05:06 +01:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace UnityAtoms
|
|
|
|
{
|
2018-11-13 19:48:17 +01:00
|
|
|
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Float")]
|
2018-10-30 20:05:06 +01:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|