using System; namespace UnityEngine.XR.ARFoundation { /// /// Data associated with an event. /// public struct ARPlaneBoundaryChangedEventArgs : IEquatable { /// /// The which triggered the event. /// public ARPlane plane { get; } /// /// Constructor for plane changed events. /// This is normally only used by the component for events. /// /// The that triggered the event. /// Thrown if is `null`. public ARPlaneBoundaryChangedEventArgs(ARPlane plane) { if (plane == null) throw new ArgumentNullException(nameof(plane)); this.plane = plane; } /// /// Generates a hash suitable for use with containers like `HashSet` and `Dictionary`. /// /// A hash code generated from this object's fields. public override int GetHashCode() => HashCodeUtil.ReferenceHash(plane); /// /// Tests for equality. /// /// The `object` to compare against. /// `True` if is of type and /// also returns `true`; otherwise `false`. public override bool Equals(object obj) { return obj is ARPlaneBoundaryChangedEventArgs args && Equals(args); } /// /// Generates a string representation fo this . /// /// A string representation fo this . public override string ToString() => $"ARPlane {(plane ? plane.trackableId.ToString() : "(null)")} boundary updated"; /// /// Tests for equality. /// /// The other to compare against. /// `True` if every field in is equal to this , otherwise false. public bool Equals(ARPlaneBoundaryChangedEventArgs other) => plane == other.plane; /// /// Tests for equality. Same as . /// /// The left-hand side of the comparison. /// The right-hand side of the comparison. /// `True` if is equal to , otherwise `false`. public static bool operator ==(ARPlaneBoundaryChangedEventArgs lhs, ARPlaneBoundaryChangedEventArgs rhs) => lhs.Equals(rhs); /// /// Tests for inequality. Same as `!`. /// /// The left-hand side of the comparison. /// The right-hand side of the comparison. /// `True` if is not equal to , otherwise `false`. public static bool operator !=(ARPlaneBoundaryChangedEventArgs lhs, ARPlaneBoundaryChangedEventArgs rhs) => !lhs.Equals(rhs); } }