Exemplo n.º 1
0
    private void OnApplicationPause(bool pause)
    {
        var headdof = Pvr_UnitySDKManager.SDK.HmdOnlyrot ? 0 : 1;
        var handdof = Pvr_UnitySDKManager.SDK.ControllerOnlyrot ? 0 : 1;

        if (pause)
        {
            if (controllerlink.neoserviceStarted)
            {
                controllerlink.SetGameObjectToJar("");
                controllerlink.StopControllerThread(headdof, handdof);
            }
            if (controllerlink.goblinserviceStarted)
            {
                controllerlink.StopLark2Receiver();
            }
        }
        else
        {
            controllerlink.Controller0 = new ControllerHand();
            controllerlink.Controller1 = new ControllerHand();
            if (controllerlink.neoserviceStarted)
            {
                controllerlink.SetGameObjectToJar(this.gameObject.name);
                controllerlink.SetUnityVersionToJar(Pvr_UnitySDKAPI.System.UnitySDKVersion);
                controllerlink.StartControllerThread(headdof, handdof);
            }
            if (controllerlink.goblinserviceStarted)
            {
                controllerlink.StartLark2Receiver();
                controllerlink.controller0Connected = GetControllerConnectionState(0) == 1;
                controllerlink.controllerType       = controllerlink.GetControllerType();
                controllerlink.handness             = (Pvr_Controller.UserHandNess)controllerlink.getHandness();

                if (PvrServiceStartSuccessEvent != null)
                {
                    PvrServiceStartSuccessEvent();
                }
            }
        }
    }
Exemplo n.º 2
0
    private void OnApplicationPause(bool pause)
    {
        var headdof = Pvr_UnitySDKManager.SDK.HeadDofNum == HeadDofNum.SixDof ? 1 : 0;
        var handdof = Pvr_UnitySDKManager.SDK.HandDofNum == HandDofNum.SixDof ? 1 : 0;

        if (pause)
        {
            //仅在CV设备&当前启动CV服务时
            if (controllerlink.cvserviceBindState)
            {
                controllerlink.SetGameObjectToJar("");
                controllerlink.StopControllerThread(headdof, handdof);
            }
        }
        else
        {
            if (controllerlink.cvserviceBindState)
            {
                controllerlink.SetGameObjectToJar(controllerlink.gameobjname);
                controllerlink.StartControllerThread(headdof, handdof);
            }
        }
    }
Exemplo n.º 3
0
    private void OnApplicationPause(bool pause)
    {
        var headdof = Pvr_UnitySDKManager.SDK.HeadDofNum == HeadDofNum.SixDof ? 1 : 0;
        var handdof = Pvr_UnitySDKManager.SDK.HandDofNum == HandDofNum.SixDof ? 1 : 0;

        if (pause)
        {
            if (controllerlink.neoserviceStarted)
            {
                controllerlink.SetGameObjectToJar("");
                controllerlink.StopControllerThread(headdof, handdof);
            }
            if (controllerlink.goblinserviceStarted)
            {
                controllerlink.StopLark2Receiver();
            }
        }
        else
        {
            controllerlink.Controller0 = new ControllerHand();
            controllerlink.Controller1 = new ControllerHand();
            if (controllerlink.neoserviceStarted)
            {
                controllerlink.SetGameObjectToJar(controllerlink.gameobjname);
                controllerlink.StartControllerThread(headdof, handdof);
            }
            if (controllerlink.goblinserviceStarted)
            {
                controllerlink.StartLark2Receiver();
                controllerlink.controller0Connected = GetControllerConnectionState(0) == 1;
                if (PvrServiceStartSuccessEvent != null)
                {
                    PvrServiceStartSuccessEvent();
                }
            }
        }
    }
Exemplo n.º 4
0
    private void OnApplicationPause(bool pause)
    {
        var headdof = Pvr_UnitySDKManager.SDK.HeadDofNum == HeadDofNum.SixDof ? 1 : 0;
        var handdof = Pvr_UnitySDKManager.SDK.HandDofNum == HandDofNum.SixDof ? 1 : 0;

        if (pause)
        {
            //仅在CV设备&当前启动CV服务时
            if (controllerlink.cvserviceBindState)
            {
                controllerlink.SetGameObjectToJar("");
                controllerlink.StopControllerThread(headdof, handdof);
            }
            else if (controllerlink.hbserviceBindState)
            {
                controllerlink.StopLark2Receiver();
            }
        }
        else
        {
            if (controllerlink.cvserviceBindState)
            {
                controllerlink.SetGameObjectToJar(controllerlink.gameobjname);
                controllerlink.StartControllerThread(headdof, handdof);
            }
            else if (controllerlink.hbserviceBindState)
            {
                controllerlink.StartLark2Receiver();
                controllerlink.controller0Connected = GetControllerConnectionState(0) == 2;
                if (!controllerlink.controller0Connected)
                {
                    controllerlink.Controller0 = new ControllerHand();
                }
            }
        }
    }