Exemple #1
0
        private void processMovement()
        {
            float   horizon  = Input.GetAxis("Horizontal");
            float   vertical = Input.GetAxis("Vertical");
            Vector3 h        = horizon * Camera.main.transform.right;
            Vector3 v        = vertical * Camera.main.transform.forward;

            previousMoveDir = currentMoveDir;
            currentMoveDir  = (h + v).normalized;

            if (horizon == 0f && vertical == 0f)
            {
                if (previousMoveDir != Vector3.zero)
                {
                    PlayerCamera.EnabledInput = true;
                }

                return;
            }

            if (moveCoroutine != null)
            {
                this.stopAutoMove();
            }

            PlayerCamera.EnabledInput = false;
            PlayerCamera.HideCursor();
            movement.moveAmount = Mathf.Clamp01(new Vector2(horizon, vertical).sqrMagnitude);
            movement.direction  = currentMoveDir * movement.moveAmount * Time.deltaTime;
            this.updateMovement(movement);
            notifyCharacterMovement();
        }
        private void closeMap()
        {
            UIModalManager.EnabledInput = true;
            PlayerCamera.EnabledInput   = true;
            PlayerCamera.HideCursor();

            playerController.unblockInput();
            playerStateManager.enableRootMotion();
            StartCoroutine(FadeOutMap());
        }
        private void openMap()
        {
            UIModalManager.EnabledInput = false;
            PlayerCamera.EnabledInput   = false;
            PlayerCamera.ShowCursor();

            playerController.stopMovement();
            playerController.blockInput();
            playerStateManager.disableRootMotion();

            createViewTexture();
            StartCoroutine(FadeInMap());
        }
Exemple #4
0
        private void disableInputBox()
        {
            PlayerCamera.HideCursor();
            PlayerCamera.EnabledInput   = true;
            UIModalManager.EnabledInput = true;
            if (!playerController.IsAutoMoving)
            {
                playerController.unblockInput();
                playerController.stopMovement();
            }

            inputField.text = "";
            chatInputBox.SetActive(false);
        }
Exemple #5
0
        private void enableInputBox()
        {
            PlayerCamera.ShowCursor();
            PlayerCamera.EnabledInput   = false;
            UIModalManager.EnabledInput = false;
            if (!playerController.IsAutoMoving)
            {
                playerController.blockInput();
                playerController.stopMovement();
            }

            chatInputBox.SetActive(true);
            inputField.ActivateInputField();
        }