mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-23 08:38:23 -05:00
20 lines
617 B
C#
20 lines
617 B
C#
using UnityEngine;
|
|
|
|
namespace UnityAtoms
|
|
{
|
|
[EditorIcon("atom-icon-lush")]
|
|
[CreateAssetMenu(menuName = "Unity Atoms/Variables/Float", fileName = "FloatVariable")]
|
|
public sealed class FloatVariable : EquatableAtomVariable<float, FloatEvent, FloatFloatEvent>, IWithApplyChange<float, FloatEvent, FloatFloatEvent>
|
|
{
|
|
public bool ApplyChange(float amount)
|
|
{
|
|
return SetValue(Value + amount);
|
|
}
|
|
|
|
public bool ApplyChange(EquatableAtomVariable<float, FloatEvent, FloatFloatEvent> amount)
|
|
{
|
|
return SetValue(Value + amount.Value);
|
|
}
|
|
}
|
|
}
|