A game about forced loneliness, made by TACStudios
1using System;
2using UnityEngine.UI;
3
4namespace Unity.VisualScripting
5{
6 /// <summary>
7 /// Called when the current value of the scrollbar has changed.
8 /// </summary>
9 [UnitCategory("Events/GUI")]
10 [TypeIcon(typeof(Scrollbar))]
11 [UnitOrder(6)]
12 public sealed class OnScrollbarValueChanged : GameObjectEventUnit<float>
13 {
14 public override Type MessageListenerType => typeof(UnityOnScrollbarValueChangedMessageListener);
15 protected override string hookName => EventHooks.OnScrollbarValueChanged;
16
17 /// <summary>
18 /// The new position value of the scrollbar.
19 /// </summary>
20 [DoNotSerialize]
21 [PortLabelHidden]
22 public ValueOutput value { get; private set; }
23
24 protected override void Definition()
25 {
26 base.Definition();
27
28 value = ValueOutput<float>(nameof(value));
29 }
30
31 protected override void AssignArguments(Flow flow, float value)
32 {
33 flow.SetValue(this.value, value);
34 }
35 }
36}