Exemple #1
0
        private static void RegisterDescriptor(XRReferencePointSubsystemDescriptor overrideDescriptor = default)
        {
            if (overrideDescriptor != null)
            {
                // Clone descriptor
                var cinfo = new XRReferencePointSubsystemDescriptor.Cinfo
                {
                    id = overrideDescriptor.id,
                    subsystemImplementationType  = overrideDescriptor.subsystemImplementationType,
                    supportsTrackableAttachments = overrideDescriptor.supportsTrackableAttachments
                };

                originalDescriptor = typeof(XRReferencePointSubsystemDescriptor).GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance)[0]
                                     .Invoke(new object[] { cinfo }) as XRReferencePointSubsystemDescriptor;

                // Override subsystem
                overrideDescriptor.subsystemImplementationType = typeof(UnityXRMockReferencePointSubsystem);
            }
            else
            {
                XRReferencePointSubsystemDescriptor.Create(new XRReferencePointSubsystemDescriptor.Cinfo
                {
                    id = ID,
                    subsystemImplementationType  = typeof(UnityXRMockReferencePointSubsystem),
                    supportsTrackableAttachments = true
                });
            }
        }
Exemple #2
0
        static void RegisterDescriptor()
        {
            var cinfo = new XRReferencePointSubsystemDescriptor.Cinfo
            {
                id = "ARKit-ReferencePoint",
                subsystemImplementationType  = typeof(ARKitReferencePointSubsystem),
                supportsTrackableAttachments = true
            };

            XRReferencePointSubsystemDescriptor.Create(cinfo);
        }
Exemple #3
0
        static void RegisterDescriptor()
        {
#if UNITY_ANDROID && !UNITY_EDITOR
            var cinfo = new XRReferencePointSubsystemDescriptor.Cinfo
            {
                id = "ARCore-ReferencePoint",
                subsystemImplementationType  = typeof(ARCoreReferencePointSubsystem),
                supportsTrackableAttachments = true
            };

            XRReferencePointSubsystemDescriptor.Create(cinfo);
#endif
        }