Пример #1
0
            public void Process()
            {
                // Save the previous Game Object
                GameObject gazeObjectPrevious = GetCurrentGameObject();

                CastRayFromGaze();
                UpdateCurrentObject();
                UpdateReticle(gazeObjectPrevious);

                // Handle input
                //if(!Input.GetMouseButtonDown(0)&&Input.GetMouseButton(0)) {
                //	HandleDrag();
                //} else if(Time.unscaledTime-pointerData.clickTime<clickTime) {
                //	// Delay new events until clickTime has passed.
                //} else if(!pointerData.eligibleForClick&&
                //		   (GvrViewer.Instance.Triggered||Input.GetMouseButtonDown(0)||
                //			GvrController.ClickButtonDown)) {
                //	// New trigger action.
                //	HandleTrigger();
                //} else if(!GvrViewer.Instance.Triggered&&!Input.GetMouseButton(0)&&
                //		   !GvrController.ClickButton) {
                //	// Check if there is a pending click to handle.
                //	HandlePendingClick();
                //}

                // Handle input
                if (!buttonClick.GetAnyDown() && buttonClick.Get())
                {
                    HandleDrag();
                }
                else if (Time.unscaledTime - pointerData.clickTime < clickTime)
                {
                    // Delay new events until clickTime has passed.
                }
                else if (!pointerData.eligibleForClick &&
                         (buttonClick.GetAnyDown()))
                {
                    // New trigger action.
                    HandleTrigger();
                }
                else if (!buttonClick.Get())
                {
                    // Check if there is a pending click to handle.
                    HandlePendingClick();
                }
            }
Пример #2
0
 public virtual void RecenterOnVRContextRecenter()
 {
     //
     if (m_HmdInput != null)
     {
         m_WaitFramesForHmdRecentering = 2;
     }
     for (int i = 0, imax = inputs.Length; i < imax; ++i)
     {
         inputs[i].OnVRContextRecenter();
     }
     //
     if (buttonRecenter.Get())
     {
         Recenter();
     }
 }