using System;
namespace UnityEngine.XR.ARFoundation
{
///
/// Event arguments for the event.
///
public readonly struct ARTrackablesParentTransformChangedEventArgs : IEquatable
{
///
/// (Read Only) The whose has
/// changed.
///
public ARSessionOrigin sessionOrigin { get; }
///
/// (Read Only) The parent transform for all s under a .
///
public Transform trackablesParent { get; }
///
/// Constructs an .
///
/// The whose
/// has changed.
/// The parent transform for all s under the
/// .
/// Thrown if is `null`.
/// Thrown if is `null`.
public ARTrackablesParentTransformChangedEventArgs(ARSessionOrigin sessionOrigin, Transform trackablesParent)
{
if (sessionOrigin == null)
throw new ArgumentNullException(nameof(sessionOrigin));
if (trackablesParent == null)
throw new ArgumentNullException(nameof(trackablesParent));
this.sessionOrigin = sessionOrigin;
this.trackablesParent = trackablesParent;
}
///
/// Compares for equality.
///
/// The other to compare against.
/// Returns `true` if each property in is equal (using `==`) to the
/// corresponding property in this one. Returns `false` otherwise.
public bool Equals(ARTrackablesParentTransformChangedEventArgs other) =>
sessionOrigin == other.sessionOrigin &&
trackablesParent == other.trackablesParent;
///
/// Compares for equality.
///
/// The to compare against.
/// Returns `true` if is an
/// and it compares equal using
/// . Returns
/// `false` otherwise.
public override bool Equals(object obj) =>
obj is ARTrackablesParentTransformChangedEventArgs other && Equals(other);
///
/// Generates a hash code suitable for using in a `HashSet` or `Dictionary`.
///
/// Returns a hash code suitable for using in a `HashSet` or `Dictionary`.
public override int GetHashCode() => HashCodeUtil.Combine(
HashCodeUtil.ReferenceHash(sessionOrigin),
HashCodeUtil.ReferenceHash(trackablesParent));
///
/// Compares for equality. Same as
/// .
///
/// The to compare with .
/// The to compare with .
/// Returns `true` if is equal to using
/// . Returns
/// `false` otherwise.
public static bool operator ==(ARTrackablesParentTransformChangedEventArgs lhs, ARTrackablesParentTransformChangedEventArgs rhs)
=> lhs.Equals(rhs);
///
/// Compares for inequality.
///
/// The to compare with .
/// The to compare with .
/// Returns `false` if is equal to using
/// . Returns
/// `true` otherwise.
public static bool operator !=(ARTrackablesParentTransformChangedEventArgs lhs, ARTrackablesParentTransformChangedEventArgs rhs)
=> !lhs.Equals(rhs);
}
}