XRReferencePointSubsystemDescriptor.deprecated.cs
3.31 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
using System;
namespace UnityEngine.XR.ARSubsystems
{
/// <summary>
/// Describes the capabilities of an <see cref="XRReferencePointSubsystem"/>.
/// </summary>
[Obsolete("XRReferencePointSubsystemDescriptor has been deprecated. Use XRAnchorSubsystemDescriptor instead (UnityUpgradable) -> UnityEngine.XR.ARSubsystems.XRAnchorSubsystemDescriptor", true)]
public class XRReferencePointSubsystemDescriptor : SubsystemDescriptor<XRReferencePointSubsystem>
{
/// <summary>
/// <c>true</c> if the subsystem supports attachments, i.e., the ability to attach a reference point to a trackable.
/// </summary>
public bool supportsTrackableAttachments { get; private set; }
/// <summary>
/// Constructor info used to register a descriptor.
/// </summary>
public struct Cinfo : IEquatable<Cinfo>
{
/// <summary>
/// The string identifier for this subsystem.
/// </summary>
public string id { get; set; }
/// <summary>
/// The concrete <c>Type</c> of the subsystem which will be instantiated if a subsystem is created from this descriptor.
/// </summary>
public Type subsystemImplementationType { get; set; }
/// <summary>
/// <c>true</c> if the subsystem supports attachments, i.e., the ability to attach a reference point to a trackable.
/// </summary>
public bool supportsTrackableAttachments { get; set; }
public override int GetHashCode()
{
unchecked
{
var hash = (id == null) ? 0 : id.GetHashCode();
hash = hash * 486187739 + ((subsystemImplementationType == null) ? 0 : subsystemImplementationType.GetHashCode());
return hash;
}
}
public override bool Equals(object obj)
{
if (!(obj is Cinfo))
return false;
return Equals((Cinfo)obj);
}
public bool Equals(Cinfo other)
{
return
String.Equals(id, other.id) &&
subsystemImplementationType == other.subsystemImplementationType;
}
public static bool operator ==(Cinfo lhs, Cinfo rhs)
{
return lhs.Equals(rhs);
}
public static bool operator !=(Cinfo lhs, Cinfo rhs)
{
return !lhs.Equals(rhs);
}
}
/// <summary>
/// Creates a new subsystem descriptor and registers it with the <c>SubsystemManager</c>.
/// </summary>
/// <param name="cinfo">Constructor info describing the descriptor to create.</param>
public static void Create(Cinfo cinfo)
{
SubsystemRegistration.CreateDescriptor(new XRReferencePointSubsystemDescriptor(cinfo));
}
XRReferencePointSubsystemDescriptor(Cinfo cinfo)
{
id = cinfo.id;
subsystemImplementationType = cinfo.subsystemImplementationType;
supportsTrackableAttachments = cinfo.supportsTrackableAttachments;
}
}
}