2018-10-30 15:05:06 -04:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace UnityAtoms
|
|
|
|
{
|
2019-10-02 11:36:20 -04:00
|
|
|
[UseIcon("atom-icon-lush")]
|
2019-05-29 12:52:27 -04:00
|
|
|
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Float", fileName = "FloatVariable")]
|
2019-09-25 15:05:06 -04:00
|
|
|
public sealed class FloatVariable : EquatableAtomVariable<float, FloatEvent, FloatFloatEvent>, IWithApplyChange<float, FloatEvent, FloatFloatEvent>
|
2018-10-30 15:05:06 -04:00
|
|
|
{
|
|
|
|
public bool ApplyChange(float amount)
|
|
|
|
{
|
|
|
|
return SetValue(Value + amount);
|
|
|
|
}
|
|
|
|
|
2019-09-25 15:05:06 -04:00
|
|
|
public bool ApplyChange(EquatableAtomVariable<float, FloatEvent, FloatFloatEvent> amount)
|
2018-10-30 15:05:06 -04:00
|
|
|
{
|
|
|
|
return SetValue(Value + amount.Value);
|
|
|
|
}
|
|
|
|
}
|
2019-04-07 05:10:09 -04:00
|
|
|
}
|