ARPlaneBoundaryChangedEventArgs.cs
2 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
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
namespace UnityEngine.XR.ARFoundation
{
/// <summary>
/// Data associated with an <see cref="ARPlane.boundaryChanged" /> event.
/// </summary>
public struct ARPlaneBoundaryChangedEventArgs : IEquatable<ARPlaneBoundaryChangedEventArgs>
{
/// <summary>
/// The <see cref="ARPlane" /> which triggered the event.
/// </summary>
public ARPlane plane { get; private set; }
/// <summary>
/// Constructor for plane changed events.
/// This is normally only used by the <see cref="ARPlane"/> component for <see cref="ARPlane.boundaryChanged"/> events.
/// </summary>
/// <param name="plane">The <see cref="ARPlane"/> that triggered the event.</param>
public ARPlaneBoundaryChangedEventArgs(ARPlane plane)
{
if (plane == null)
throw new ArgumentNullException("plane");
this.plane = plane;
}
public override int GetHashCode()
{
unchecked
{
var hash = plane == null ? 0 : plane.GetHashCode();
return hash;
}
}
public override bool Equals(object obj)
{
if (!(obj is ARPlaneBoundaryChangedEventArgs))
return false;
return Equals((ARPlaneBoundaryChangedEventArgs)obj);
}
public override string ToString()
{
return plane.trackableId.ToString();
}
public bool Equals(ARPlaneBoundaryChangedEventArgs other)
{
return (plane == other.plane);
}
public static bool operator ==(ARPlaneBoundaryChangedEventArgs lhs, ARPlaneBoundaryChangedEventArgs rhs)
{
return lhs.Equals(rhs);
}
public static bool operator !=(ARPlaneBoundaryChangedEventArgs lhs, ARPlaneBoundaryChangedEventArgs rhs)
{
return !lhs.Equals(rhs);
}
}
}