Ejemplo n.º 1
0
        public void UnregisterPointer(XRUIPointer pointer)
        {
            EnsureInitialized();

            for (int i = 0; i < m_RegisteredPointers.Count; i++)
            {
                if (m_RegisteredPointers[i].pointer == pointer)
                {
                    RegisteredPointer registeredPointer = m_RegisteredPointers[i];
                    registeredPointer.pointer = null;
                    m_RegisteredPointers[i]   = registeredPointer;
                    return;
                }
            }
        }
Ejemplo n.º 2
0
        protected override void DoProcess()
        {
            EnsureInitialized();

            if (m_EnableXRInput)
            {
                for (int i = 0; i < m_RegisteredPointers.Count; i++)
                {
                    RegisteredPointer registeredPointer = m_RegisteredPointers[i];

                    //Update the raycast distance in case it's changed between frames
                    registeredPointer.model.maxRaycastDistance = m_MaxTrackedDeviceRaycastDistance;

                    //If device is removed, we send a default state to unclick any UI
                    if (registeredPointer.pointer == null)
                    {
                        registeredPointer.model.Reset();
                        ProcessTrackedDevice(ref registeredPointer.model);
                        m_RegisteredPointers.RemoveAt(i--);
                    }
                    else
                    {
                        registeredPointer.pointer.UpdateModel(ref registeredPointer.model);
                        ProcessTrackedDevice(ref registeredPointer.model);
                        m_RegisteredPointers[i] = registeredPointer;
                    }
                }
            }

            if (m_EnableMouseInput)
            {
                ProcessMouse();
            }

            if (m_EnableTouchInput)
            {
                ProcessTouches();
            }
        }