Skip to main content

Object Comparator

Object Comparator

Compares two objects (derived from UnityEngine.Object) using a specified comparator.

Comparison against None (Object) means comparing against a null object.

Inputs

  • A: First object.
  • Comparator: The comparator to use.
    • Equals
    • Not Equals
  • B: Second object.
  • Destroyed Means Null: If unchecked, then reference comparison will be done using ReferenceEquals instead of the == operator. ReferenceEquals against null returns true even if the object is destroyed, and only returns false if the reference is truly null. Although it is safer to treat destroyed objects as null, please note that using the == operator on UnityEngine.Object incurs a higher performance cost as described in Unity's General Optimizations.

Outputs

  • Out: The boolean result whether it matches the comparator condition or not.