UnityGame/Library/PackageCache/com.unity.visualscripting/Runtime/VisualScripting.Flow/Framework/Logic/NotEqual.cs

39 lines
978 B
C#
Raw Permalink Normal View History

2024-10-27 10:53:47 +03:00
using UnityEngine;
namespace Unity.VisualScripting
{
/// <summary>
/// Compares two inputs to determine whether they are not equal.
/// </summary>
[UnitCategory("Logic")]
[UnitOrder(6)]
public sealed class NotEqual : BinaryComparisonUnit
{
public NotEqual() : base()
{
numeric = false;
}
// Backward compatibility
protected override string outputKey => "notEqual";
/// <summary>
/// Whether A is different than B.
/// </summary>
[DoNotSerialize]
[PortLabel("A \u2260 B")]
[PortKey("notEqual")]
public override ValueOutput comparison => base.comparison;
protected override bool NumericComparison(float a, float b)
{
return !Mathf.Approximately(a, b);
}
protected override bool GenericComparison(object a, object b)
{
return OperatorUtility.NotEqual(a, b);
}
}
}