Exemplo n.º 1
0
 void NoloRecenter()
 {
     //leftcontroller double click system button
     if (GvrControllerInput.GetControllerState(SvrControllerState.NoloLeftContoller).homeButtonUp ||
         GvrControllerInput.GetControllerState(SvrControllerState.NoloRightContoller).homeButtonUp)
     //if (NoloVR_Controller.GetDevice(NoloDeviceType.LeftController).GetNoloButtonUp(NoloButtonID.System))
     {
         if (Time.frameCount - leftcontrollerRecenter_PreFrame <= recenterSpacingFrame)
         {
             //UnityEngine.XR.InputTracking.Recenter();
             Recenter();
             leftcontrollerRecenter_PreFrame = -1;
         }
         else
         {
             leftcontrollerRecenter_PreFrame = Time.frameCount;
         }
     }
     //rightcontroller double click system button
     //if (NoloVR_Controller.GetDevice(NoloDeviceType.RightController).GetNoloButtonUp(NoloButtonID.System))
     //if (GvrControllerInput.HomeButtonUp)
     //{
     //    if (Time.frameCount - rightcontrollerRecenter_PreFrame <= recenterSpacingFrame)
     //    {
     //        //UnityEngine.XR.InputTracking.Recenter();
     //        Recenter();
     //        rightcontrollerRecenter_PreFrame = -1;
     //    }
     //    else
     //    {
     //        rightcontrollerRecenter_PreFrame = Time.frameCount;
     //    }
     //}
 }
Exemplo n.º 2
0
    void Update()
    {
        //Update_LED(NoloVR_Plugins.GetElectricity(trackedDevice.devicetype));
        if (GvrControllerInput.GetControllerState(trackedDevice.deviceType).clickButtonState)
        {
            TouchPad_Down();
        }
        else
        {
            TouchPad_Up();
        }

        //if (NoloVR_Controller.GetDevice(trackedDevice).GetNoloButtonPressed(NoloButtonID.Menu))
        if (GvrControllerInput.GetControllerState(trackedDevice.deviceType).appButtonState)
        {
            Menu_Down();
        }
        else
        {
            Menu_Up();
        }
        if (GvrControllerInput.GetControllerState(trackedDevice.deviceType).homeButtonState)
        //if (NoloVR_Controller.GetDevice(trackedDevice).GetNoloButtonPressed(NoloButtonID.System))
        {
            System_Down();
        }
        else
        {
            System_Up();
        }
        //if (GvrControllerInput.GetControllerState(trackedDevice.deviceType).homeButtonState)
        //    //if (NoloVR_Controller.GetDevice(trackedDevice).GetNoloButtonPressed(NoloButtonID.Grip))
        //{
        //    Grip_Down();
        //}
        //else
        //{
        //    Grip_Up();
        //}
        if (GvrControllerInput.GetControllerState(trackedDevice.deviceType).triggerButtonState)
        //if (NoloVR_Controller.GetDevice(trackedDevice).GetNoloButtonPressed(NoloButtonID.Trigger))
        {
            Trigger_Down();
        }
        else
        {
            Trigger_Up();
        }
    }
Exemplo n.º 3
0
 void NoloRecenter()
 {
     //leftcontroller double click system button
     if (GvrControllerInput.GetControllerState(SvrControllerState.NoloLeftContoller).homeButtonUp ||
         GvrControllerInput.GetControllerState(SvrControllerState.NoloRightContoller).homeButtonUp)
     {
         if (Time.frameCount - leftcontrollerRecenter_PreFrame <= recenterSpacingFrame)
         {
             if (RecenteredCallback != null)
             {
                 RecenteredCallback(Camera.main.transform.forward);
             }
             leftcontrollerRecenter_PreFrame = -1;
         }
         else
         {
             leftcontrollerRecenter_PreFrame = Time.frameCount;
         }
     }
 }