using System; namespace UnityEngine.XR.ARSubsystems { /// /// Update parameters for . /// public struct XRSessionUpdateParams : IEquatable { /// /// The current screen orientation. /// public ScreenOrientation screenOrientation { get; set; } /// /// The current screen dimensions. /// public Vector2Int screenDimensions { get; set; } /// /// Generates a hash code suitable for use in a `Dictionary` or `HashSet`. /// /// A hash code of this . public override int GetHashCode() => HashCodeUtil.Combine(((int)screenOrientation).GetHashCode(), screenDimensions.GetHashCode()); /// /// Compares for equality. /// /// The object to compare against. /// true if is of type and is true. public override bool Equals(object obj) => (obj is XRSessionUpdateParams) && Equals((XRSessionUpdateParams)obj); /// /// Generates a string suitable for debugging. /// /// A string representation of the update parameters. public override string ToString() => $"Screen Orientation: {screenOrientation}, Screen Dimensions: {screenDimensions}"; /// /// Compares for equality. /// /// The other to compare against. /// true if the other is equal to this one. public bool Equals(XRSessionUpdateParams other) => (screenOrientation == other.screenOrientation) && screenDimensions.Equals(other.screenDimensions); /// /// Compares for equality. /// /// The left-hand side of the comparison. /// The right-hand side of the comparison. /// The same as . public static bool operator ==(XRSessionUpdateParams lhs, XRSessionUpdateParams rhs) => lhs.Equals(rhs); /// /// Compares for inequality. /// /// The left-hand side of the comparison. /// The right-hand side of the comparison. /// The negation of . public static bool operator !=(XRSessionUpdateParams lhs, XRSessionUpdateParams rhs) => !lhs.Equals(rhs); } }