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 toggle has changed.
8 /// </summary>
9 [UnitCategory("Events/GUI")]
10 [TypeIcon(typeof(Toggle))]
11 [UnitOrder(5)]
12 public sealed class OnToggleValueChanged : GameObjectEventUnit<bool>
13 {
14 public override Type MessageListenerType => typeof(UnityOnToggleValueChangedMessageListener);
15 protected override string hookName => EventHooks.OnToggleValueChanged;
16
17 /// <summary>
18 /// The new boolean value of the toggle.
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<bool>(nameof(value));
29 }
30
31 protected override void AssignArguments(Flow flow, bool value)
32 {
33 flow.SetValue(this.value, value);
34 }
35 }
36}