Açıklama Yok
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.

NotEqual.cs 978B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using UnityEngine;
  2. namespace Unity.VisualScripting
  3. {
  4. /// <summary>
  5. /// Compares two inputs to determine whether they are not equal.
  6. /// </summary>
  7. [UnitCategory("Logic")]
  8. [UnitOrder(6)]
  9. public sealed class NotEqual : BinaryComparisonUnit
  10. {
  11. public NotEqual() : base()
  12. {
  13. numeric = false;
  14. }
  15. // Backward compatibility
  16. protected override string outputKey => "notEqual";
  17. /// <summary>
  18. /// Whether A is different than B.
  19. /// </summary>
  20. [DoNotSerialize]
  21. [PortLabel("A \u2260 B")]
  22. [PortKey("notEqual")]
  23. public override ValueOutput comparison => base.comparison;
  24. protected override bool NumericComparison(float a, float b)
  25. {
  26. return !Mathf.Approximately(a, b);
  27. }
  28. protected override bool GenericComparison(object a, object b)
  29. {
  30. return OperatorUtility.NotEqual(a, b);
  31. }
  32. }
  33. }