Ejemplo n.º 1
0
        public bool Pause()
        {
            if (isPaused || !canPause)
            {
                return(false);
            }

            PauseMenu.PauseMenu.Instance.show = true;
            isPaused = true;
            Debug.Log("Paused");

            // Disable BioIK & wheelchair
            EnableControlManager.Instance.leftBioIKGroup.SetEnabled(false);
            EnableControlManager.Instance.rightBioIKGroup.SetEnabled(false);
            UnityAnimusClient.Instance._myIKHead.enabled = false;
            PedalDriver.Instance.enabled = false;

            WheelchairStateManager.Instance.SetVisibility(true, StateManager.Instance.currentState == StateManager.States.HUD ? WheelchairStateManager.HUDAlpha : 1);

            oldMotorEnabled = UnityAnimusClient.Instance.motorEnabled;
            //UnityAnimusClient.Instance.EnableMotor(false);

            if (pauseAudio)
            {
                AudioListener.pause = true;
            }

            // switch gloves to paused mode
            leftGlove.SwitchControllers();
            leftGlove.ghostHand.SetActive(true);
            rightGlove.SwitchControllers();
            rightGlove.ghostHand.SetActive(true);

            onPause.Call(true);
            return(true);
        }