A game about forced loneliness, made by TACStudios
1namespace Unity.VisualScripting
2{
3 [UnitOrder(601)]
4 public abstract class PerSecond<T> : Unit
5 {
6 /// <summary>
7 /// The input value.
8 /// </summary>
9 [DoNotSerialize]
10 [PortLabelHidden]
11 public ValueInput input { get; private set; }
12
13 /// <summary>
14 /// The framerate-normalized value (multiplied by delta time).
15 /// </summary>
16 [DoNotSerialize]
17 [PortLabelHidden]
18 public ValueOutput output { get; private set; }
19
20 protected override void Definition()
21 {
22 input = ValueInput(nameof(input), default(T));
23 output = ValueOutput(nameof(output), Operation);
24
25 Requirement(input, output);
26 }
27
28 public abstract T Operation(T input);
29
30 public T Operation(Flow flow)
31 {
32 return Operation(flow.GetValue<T>(input));
33 }
34 }
35}