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.

LessOrEqual.cs 800B

12345678910111213141516171819202122232425262728
  1. using UnityEngine;
  2. namespace Unity.VisualScripting
  3. {
  4. /// <summary>
  5. /// Compares two inputs to determine whether the first is less than or equal to the second.
  6. /// </summary>
  7. [UnitCategory("Logic")]
  8. [UnitOrder(10)]
  9. public sealed class LessOrEqual : BinaryComparisonUnit
  10. {
  11. /// <summary>
  12. /// Whether A is greater than or equal to B.
  13. /// </summary>
  14. [PortLabel("A \u2264 B")]
  15. public override ValueOutput comparison => base.comparison;
  16. protected override bool NumericComparison(float a, float b)
  17. {
  18. return a < b || Mathf.Approximately(a, b);
  19. }
  20. protected override bool GenericComparison(object a, object b)
  21. {
  22. return OperatorUtility.LessThanOrEqual(a, b);
  23. }
  24. }
  25. }