using System;
using UnityEngine.UI;
namespace Unity.VisualScripting
{
///
/// Called when the current value of the slider has changed.
///
[UnitCategory("Events/GUI")]
[TypeIcon(typeof(Slider))]
[UnitOrder(8)]
public sealed class OnSliderValueChanged : GameObjectEventUnit
{
public override Type MessageListenerType => typeof(UnityOnSliderValueChangedMessageListener);
protected override string hookName => EventHooks.OnSliderValueChanged;
///
/// The new numeric value of the slider.
///
[DoNotSerialize]
[PortLabelHidden]
public ValueOutput value { get; private set; }
protected override void Definition()
{
base.Definition();
value = ValueOutput(nameof(value));
}
protected override void AssignArguments(Flow flow, float value)
{
flow.SetValue(this.value, value);
}
}
}