Singularity/Library/PackageCache/com.unity.visualscripting@1.../Runtime/VisualScripting.Flow/Framework/Logic/LessOrEqual.cs

29 lines
800 B
C#
Raw Permalink Normal View History

2024-05-06 14:45:45 -04:00
using UnityEngine;
namespace Unity.VisualScripting
{
/// <summary>
/// Compares two inputs to determine whether the first is less than or equal to the second.
/// </summary>
[UnitCategory("Logic")]
[UnitOrder(10)]
public sealed class LessOrEqual : BinaryComparisonUnit
{
/// <summary>
/// Whether A is greater than or equal to B.
/// </summary>
[PortLabel("A \u2264 B")]
public override ValueOutput comparison => base.comparison;
protected override bool NumericComparison(float a, float b)
{
return a < b || Mathf.Approximately(a, b);
}
protected override bool GenericComparison(object a, object b)
{
return OperatorUtility.LessThanOrEqual(a, b);
}
}
}