// ReSharper disable ConvertToAutoPropertyWhenPossible using System; namespace UnityEngine.XR.ARSubsystems { /// /// Represents the near and far planes of a depth image. /// public readonly struct XRNearFarPlanes : IEquatable { /// /// The near plane, in meters. /// public float nearZ => m_NearZ; readonly float m_NearZ; /// /// The far plane, in meters. /// public float farZ => m_FarZ; readonly float m_FarZ; /// /// Constructor. /// /// The near plane, in meters. /// The far plane, in meters. public XRNearFarPlanes(float nearZ, float farZ) { m_NearZ = nearZ; m_FarZ = farZ; } /// /// Indicates whether this instance is equal to another object of the same type. /// /// An object to compare with this instance. /// if this instance is equal to . /// Otherwise, . public bool Equals(XRNearFarPlanes other) => m_NearZ.Equals(other.m_NearZ) && m_FarZ.Equals(other.m_FarZ); /// /// Indicates whether this instance is equal to another object. /// Casts the other object to `XRNearFarPlanes`, then returns . /// /// An object to compare with this instance. /// if this instance is equal to . /// Otherwise, . public override bool Equals(object obj) => obj is XRNearFarPlanes other && Equals(other); /// /// Get a hash code for this instance. /// /// The hash code. public override int GetHashCode() => HashCode.Combine(m_NearZ, m_FarZ); /// /// Generates a string representation of this instance suitable for debugging purposes. /// /// The string. public override string ToString() => $"{{\n nearZ: {m_NearZ}\n farZ: {m_FarZ}\n}}"; } }