public static void _Update(GameState gameState)
        {
            bool cursorLock = false;
            bool moveLock   = false;
            bool cameraIsOn = false;

            if (gameState == GameState.Normal)
            {
                cursorLock = KickStarter.playerInput.cursorIsLocked;
                moveLock   = !KickStarter.playerInput.isUpLocked;
                cameraIsOn = true;
            }

            if (gameState != GameState.Paused)
            {
                UltimateFPSIntegration.SetCameraEnabled(cameraIsOn);
            }

            UltimateFPSIntegration.SetMovementState(moveLock);
            UltimateFPSIntegration.SetCameraState(cursorLock);
        }
Beispiel #2
0
        override public float Run()
        {
            if (changeMovementMethod)
            {
                if (KickStarter.settingsManager.IsInFirstPerson() && newMovementMethod != MovementMethod.FirstPerson && newMovementMethod != MovementMethod.UltimateFPS)
                {
                    KickStarter.playerInput.cursorIsLocked = false;
                }
                else if (!KickStarter.settingsManager.IsInFirstPerson() && (newMovementMethod == MovementMethod.FirstPerson || newMovementMethod == MovementMethod.UltimateFPS))
                {
                    KickStarter.playerInput.cursorIsLocked = KickStarter.settingsManager.lockCursorOnStart;
                }

                KickStarter.settingsManager.movementMethod = newMovementMethod;

                if (newMovementMethod == MovementMethod.UltimateFPS)
                {
                    UltimateFPSIntegration.SetCameraState(KickStarter.playerInput.cursorIsLocked);
                }
            }

            if (cursorLock == LockType.Enabled)
            {
                KickStarter.stateHandler.cursorIsOff = false;
            }
            else if (cursorLock == LockType.Disabled)
            {
                KickStarter.stateHandler.cursorIsOff = true;
            }

            if (inputLock == LockType.Enabled)
            {
                KickStarter.stateHandler.inputIsOff = false;
            }
            else if (inputLock == LockType.Disabled)
            {
                KickStarter.stateHandler.inputIsOff = true;
            }

            if (interactionLock == LockType.Enabled)
            {
                KickStarter.stateHandler.interactionIsOff = false;
            }
            else if (interactionLock == LockType.Disabled)
            {
                KickStarter.stateHandler.interactionIsOff = true;
            }

            if (menuLock == LockType.Enabled)
            {
                KickStarter.stateHandler.menuIsOff = false;
            }
            else if (menuLock == LockType.Disabled)
            {
                KickStarter.stateHandler.menuIsOff = true;
            }

            if (movementLock == LockType.Enabled)
            {
                KickStarter.stateHandler.movementIsOff = false;
            }
            else if (movementLock == LockType.Disabled)
            {
                KickStarter.stateHandler.movementIsOff = true;
            }

            if (cameraLock == LockType.Enabled)
            {
                KickStarter.stateHandler.cameraIsOff = false;
            }
            else if (cameraLock == LockType.Disabled)
            {
                KickStarter.stateHandler.cameraIsOff = true;
            }

            if (triggerLock == LockType.Enabled)
            {
                KickStarter.stateHandler.triggerIsOff = false;
            }
            else if (triggerLock == LockType.Disabled)
            {
                KickStarter.stateHandler.triggerIsOff = true;
            }

            if (playerLock == LockType.Enabled)
            {
                KickStarter.stateHandler.playerIsOff = false;
            }
            else if (playerLock == LockType.Disabled)
            {
                KickStarter.stateHandler.playerIsOff = true;
            }

            if (saveLock == LockType.Disabled)
            {
                KickStarter.playerMenus.lockSave = true;
            }
            else if (saveLock == LockType.Enabled)
            {
                KickStarter.playerMenus.lockSave = false;
            }

            return(0f);
        }