forked from Unity-Technologies/UnityCsReference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnityXRTrackable.bindings.cs
More file actions
63 lines (54 loc) · 1.73 KB
/
Copy pathUnityXRTrackable.bindings.cs
File metadata and controls
63 lines (54 loc) · 1.73 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
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System;
using UnityEngine.Bindings;
using UnityEngine.Scripting;
using System.Runtime.InteropServices;
using System.Collections.Generic;
namespace UnityEngine.Experimental.XR
{
[NativeHeader("Modules/XR/XRManagedBindings.h")]
[UsedByNativeCode]
[StructLayout(LayoutKind.Sequential)]
public struct TrackableId
{
public override string ToString()
{
return string.Format("{0}-{1}",
m_SubId1.ToString("X16"),
m_SubId2.ToString("X16"));
}
public override int GetHashCode()
{
return m_SubId1.GetHashCode() ^ m_SubId2.GetHashCode();
}
public override bool Equals(object obj)
{
if (obj is TrackableId)
{
var id = (TrackableId)obj;
return
(m_SubId1 == id.m_SubId1) &&
(m_SubId2 == id.m_SubId2);
}
return false;
}
public static bool operator==(TrackableId id1, TrackableId id2)
{
return
(id1.m_SubId1 == id2.m_SubId1) &&
(id1.m_SubId2 == id2.m_SubId2);
}
public static bool operator!=(TrackableId id1, TrackableId id2)
{
return
(id1.m_SubId1 != id2.m_SubId1) ||
(id1.m_SubId2 != id2.m_SubId2);
}
private static TrackableId s_InvalidId = new TrackableId();
public static TrackableId InvalidId { get { return s_InvalidId; } }
private ulong m_SubId1;
private ulong m_SubId2;
}
}