Skip to main content

Object Comparator

Object Comparator

Compares 2 objects (derived from UnityEngine.Object) with certain comparator.

Comparison against None (Object) means comparing against 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 == operator. ReferenceEquals against null returns true even if the object is destroyed, and only returns false if the reference is truly null. Although it's safer to treat destroyed object as null, but please also note that using == operator on UnityEngine.Object has more performance cost as described in Unity's General Optimizations.

Outputs

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