A game about forced loneliness, made by TACStudios
1namespace Unity.VisualScripting
2{
3 [UnitOrder(403)]
4 public abstract class Angle<T> : Unit
5 {
6 /// <summary>
7 /// The first vector.
8 /// </summary>
9 [DoNotSerialize]
10 public ValueInput a { get; private set; }
11
12 /// <summary>
13 /// The second vector.
14 /// </summary>
15 [DoNotSerialize]
16 public ValueInput b { get; private set; }
17
18 /// <summary>
19 /// The angle between A and B.
20 /// </summary>
21 [DoNotSerialize]
22 [PortLabelHidden]
23 public ValueOutput angle { get; private set; }
24
25 protected override void Definition()
26 {
27 a = ValueInput<T>(nameof(a));
28 b = ValueInput<T>(nameof(b));
29 angle = ValueOutput(nameof(angle), Operation).Predictable();
30
31 Requirement(a, angle);
32 Requirement(b, angle);
33 }
34
35 private float Operation(Flow flow)
36 {
37 return Operation(flow.GetValue<T>(a), flow.GetValue<T>(b));
38 }
39
40 public abstract float Operation(T a, T b);
41 }
42}