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