示例#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
                });
            }
        }
 static void RegisterDescriptor()
 {
     XRReferencePointSubsystemDescriptor.Create(new XRReferencePointSubsystemDescriptor.Cinfo
     {
         id = "Windows Mixed Reality Reference Point",
         subsystemImplementationType  = typeof(WindowsMRReferencePointSubsystem),
         supportsTrackableAttachments = false
     });
 }
示例#3
0
        static void RegisterDescriptor()
        {
            var cinfo = new XRReferencePointSubsystemDescriptor.Cinfo
            {
                id = "ARKit-ReferencePoint",
                subsystemImplementationType  = typeof(ARKitReferencePointSubsystem),
                supportsTrackableAttachments = true
            };

            XRReferencePointSubsystemDescriptor.Create(cinfo);
        }
        static void RegisterDescriptor()
        {
#if PLATFORM_LUMIN
            XRReferencePointSubsystemDescriptor.Create(new XRReferencePointSubsystemDescriptor.Cinfo
            {
                id = "MagicLeap-ReferencePoint",
                subsystemImplementationType  = typeof(MagicLeapReferencePointSubsystem),
                supportsTrackableAttachments = false
            });
#endif
        }
示例#5
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
        }
示例#6
0
 internal static void RegisterDescriptor(XRReferencePointSubsystemDescriptor descriptor, Func <XRReferencePointSubsystem, TrackableId, Pose, TrackableId> attachReferencePoint)
 {
     if (descriptor != null)
     {
         descriptor.subsystemImplementationType = typeof(UnityXRMockReferencePointSubsystem);
     }
     else
     {
         XRReferencePointSubsystemDescriptor.Create(new XRReferencePointSubsystemDescriptor.Cinfo
         {
             id = "UnityXRMock-ReferencePoint",
             subsystemImplementationType  = typeof(UnityXRMockReferencePointSubsystem),
             supportsTrackableAttachments = true
         });
     }
 }
示例#7
0
        private void Initialize()
        {
            if (this.isInitialized)
            {
                return;
            }

            if (!UnityXRMockActivator.Active)
            {
                if (originalDescriptor == null)
                {
                    originalDescriptor = GetSubsystemDescriptor();
                }

                this.wrappedSubsystem = originalDescriptor?.Create();
            }

            this.isInitialized = true;
        }