예제 #1
0
        private void HandleOver()
        {
            // When the user looks at the rendering of the scene, show the radial.
            m_SelectionRadial.Show();

            m_GazeOver = true;
        }
예제 #2
0
 private void HandleOver()
 {
     // When the user looks at the rendering of the scene, show the radial.
     if (attachedButton.interactable == true)
     {
         timeAtGaze = Time.realtimeSinceStartup;
         m_SelectionRadial.Show();
         m_GazeOver = true;
     }
 }
        // Update is called once per frame
        void Update()
        {
            if (m_InteractiveItem.IsOver == true)
            {
                m_SelectionRadial.Show();

                if (lastScrollerStatus == false)
                {
                    momentOnView = Time.realtimeSinceStartup;
                }

                OnScrolling();
            }


            if (m_InteractiveItem.IsOver == false && lastScrollerStatus == true)
            {
                m_SelectionRadial.Hide();
            }

            lastScrollerStatus = m_InteractiveItem.IsOver;
        }
예제 #4
0
 private void HandleOver()
 {
     m_SelectionRadial.Show();
     m_GazeOver = true;
 }
예제 #5
0
        private void EyeRaycast()
        {
            // Show the debug ray if required
            if (m_ShowDebugRay)
            {
                Debug.DrawRay(m_Camera.position, m_Camera.forward * m_DebugRayLength, Color.blue, m_DebugRayDuration);
            }

            // Create a ray that points forwards from the camera.
            Ray        ray = new Ray(m_Camera.position, m_Camera.forward);
            RaycastHit hit;

            // Do the raycast forweards to see if we hit an interactive item
            if (Physics.Raycast(ray, out hit, m_RayLength, ~m_ExclusionLayers))
            {
                VRInteractiveItem interactible = hit.collider.GetComponent <VRInteractiveItem>(); //attempt to get the VRInteractiveItem on the hit object
                m_CurrentInteractible = interactible;

                // If we hit an interactive item and it's not the same as the last interactive item, then call Over
                if (interactible && interactible != m_LastInteractible)
                {
                    interactible.Over();
                }

                if (interactible)
                {
                    m_SelectionRadial.Show();
                }
                else
                {
                    m_SelectionRadial.Hide();
                }


                // Deactive the last interactive item
                if (interactible != m_LastInteractible)
                {
                    DeactiveLastInteractible();
                }

                m_LastInteractible = interactible;

                // Something was hit, set at the hit position.
                if (m_Reticle)
                {
                    m_Reticle.SetPosition(hit);
                }


                if (OnRaycasthit != null)
                {
                    OnRaycasthit(hit);
                }
            }
            else
            {
                // Nothing was hit, deactive the last interactive item.
                DeactiveLastInteractible();
                m_CurrentInteractible = null;

                // Position the reticle at default distance.
                if (m_Reticle)
                {
                    m_Reticle.SetPosition();
                }
            }
        }