暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

GreaterOrEqual.cs 809B

12345678910111213141516171819202122232425262728
  1. using UnityEngine;
  2. namespace Unity.VisualScripting
  3. {
  4. /// <summary>
  5. /// Compares two inputs to determine whether the first is greater than or equal to the second.
  6. /// </summary>
  7. [UnitCategory("Logic")]
  8. [UnitOrder(12)]
  9. public sealed class GreaterOrEqual : BinaryComparisonUnit
  10. {
  11. /// <summary>
  12. /// Whether A is greater than or equal to B.
  13. /// </summary>
  14. [PortLabel("A \u2265 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.GreaterThanOrEqual(a, b);
  23. }
  24. }
  25. }