23 lines
769 B
C#
Raw Normal View History

2018-10-30 20:05:06 +01:00
using UnityEngine;
namespace UnityAtoms
{
2019-10-15 22:29:05 +02:00
/// <summary>
/// Variable of type `float`. Inherits from `EquatableAtomVariable&lt;float, FloatEvent, FloatFloatEvent&gt;`.
/// </summary>
2019-10-14 16:51:54 +02:00
[EditorIcon("atom-icon-lush")]
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Float", fileName = "FloatVariable")]
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);
}
public bool ApplyChange(EquatableAtomVariable<float, FloatEvent, FloatFloatEvent> amount)
2018-10-30 20:05:06 +01:00
{
return SetValue(Value + amount.Value);
}
}
}