A game about forced loneliness, made by TACStudios
1using System.ComponentModel;
2using UnityEngine;
3using UnityObject = UnityEngine.Object;
4
5namespace Unity.VisualScripting
6{
7#if MODULE_ANIMATION_EXISTS
8 /// <summary>
9 /// Called when an animation event points to TriggerAnimationEvent.
10 /// </summary>
11 [UnitCategory("Events/Animation")]
12 [UnitShortTitle("Animation Event")]
13 [UnitTitle("Animation Event")]
14 [TypeIcon(typeof(AnimationClip))]
15 [DisplayName("Visual Scripting Animation Event")]
16 public sealed class BoltAnimationEvent : MachineEventUnit<AnimationEvent>
17 {
18 protected override string hookName => EventHooks.AnimationEvent;
19
20 /// <summary>
21 /// The string parameter passed to the event.
22 /// </summary>
23 [DoNotSerialize]
24 [PortLabel("String")]
25 public ValueOutput stringParameter { get; private set; }
26
27 /// <summary>
28 /// The float parameter passed to the event.
29 /// </summary>
30 [DoNotSerialize]
31 [PortLabel("Float")]
32 public ValueOutput floatParameter { get; private set; }
33
34 /// <summary>
35 /// The integer parameter passed to the function.
36 /// </summary>
37 [DoNotSerialize]
38 [PortLabel("Integer")]
39 public ValueOutput intParameter { get; private set; }
40
41 /// <summary>
42 /// The Unity object parameter passed to the function.
43 /// </summary>
44 [DoNotSerialize]
45 [PortLabel("Object")]
46 public ValueOutput objectReferenceParameter { get; private set; }
47
48 protected override void Definition()
49 {
50 base.Definition();
51
52 stringParameter = ValueOutput<string>(nameof(stringParameter));
53 floatParameter = ValueOutput<float>(nameof(floatParameter));
54 intParameter = ValueOutput<int>(nameof(intParameter));
55 objectReferenceParameter = ValueOutput<UnityObject>(nameof(objectReferenceParameter));
56 }
57
58 protected override void AssignArguments(Flow flow, AnimationEvent args)
59 {
60 flow.SetValue(stringParameter, args.stringParameter);
61 flow.SetValue(floatParameter, args.floatParameter);
62 flow.SetValue(intParameter, args.intParameter);
63 flow.SetValue(objectReferenceParameter, args.objectReferenceParameter);
64 }
65 }
66#endif
67}