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