ARRaycastUpdatedEventArgs.cs
2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
namespace UnityEngine.XR.ARFoundation
{
/// <summary>
/// Provides arguments for the <see cref="ARRaycast.updated"/> event.
/// </summary>
public struct ARRaycastUpdatedEventArgs : IEquatable<ARRaycastUpdatedEventArgs>
{
/// <summary>
/// The raycast that has been updated.
/// </summary>
public ARRaycast raycast { get; internal set; }
/// <summary>
/// Tests for equality.
/// </summary>
/// <param name="other">The event args to compare for equality.</param>
/// <returns>`True` if all properties are the same; `false` otherwise.</returns>
public bool Equals(ARRaycastUpdatedEventArgs other) => ReferenceEquals(raycast, other.raycast);
/// <summary>
/// Tests for equality.
/// </summary>
/// <param name="obj">The `object` to compare with this object.</param>
/// <returns>`True` if <paramref name="obj"/> is an <see cref="ARRaycastUpdatedEventArgs"/> and
/// <see cref="Equals(UnityEngine.XR.ARFoundation.ARRaycastUpdatedEventArgs)"/> is `true`, otherwise `false`.</returns>
public override bool Equals(object obj) => obj is ARRaycastUpdatedEventArgs other && Equals(other);
/// <summary>
/// Computes a hash code from all properties suitable for use in a `Dictionary` or `HashSet`.
/// </summary>
/// <returns>A hashcode of this object.</returns>
public override int GetHashCode() => raycast?.GetHashCode() ?? 0;
/// <summary>
/// Tests for equality. Same as <see cref="Equals(UnityEngine.XR.ARFoundation.ARRaycastUpdatedEventArgs)"/>.
/// </summary>
/// <param name="lhs">The left-hand side of the comparison.</param>
/// <param name="rhs">The right-hand side of the comparison.</param>
/// <returns>Same as <see cref="Equals(UnityEngine.XR.ARFoundation.ARRaycastUpdatedEventArgs)"/></returns>
public static bool operator ==(ARRaycastUpdatedEventArgs lhs, ARRaycastUpdatedEventArgs rhs) => lhs.Equals(rhs);
/// <summary>
/// Tests for inequality. Same as !<see cref="Equals(UnityEngine.XR.ARFoundation.ARRaycastUpdatedEventArgs)"/>
/// </summary>
/// <param name="lhs">The left-hand side of the comparison.</param>
/// <param name="rhs">The right-hand side of the comparison.</param>
/// <returns>The negation of <see cref="Equals(UnityEngine.XR.ARFoundation.ARRaycastUpdatedEventArgs)"/></returns>
public static bool operator !=(ARRaycastUpdatedEventArgs lhs, ARRaycastUpdatedEventArgs rhs) => !lhs.Equals(rhs);
}
}