No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PerSecond.cs 906B

1234567891011121314151617181920212223242526272829303132333435
  1. namespace 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. /// <summary>
  13. /// The framerate-normalized value (multiplied by delta time).
  14. /// </summary>
  15. [DoNotSerialize]
  16. [PortLabelHidden]
  17. public ValueOutput output { get; private set; }
  18. protected override void Definition()
  19. {
  20. input = ValueInput(nameof(input), default(T));
  21. output = ValueOutput(nameof(output), Operation);
  22. Requirement(input, output);
  23. }
  24. public abstract T Operation(T input);
  25. public T Operation(Flow flow)
  26. {
  27. return Operation(flow.GetValue<T>(input));
  28. }
  29. }
  30. }