Esempio n. 1
0
        private void FixedUpdate()
        {
            if (pause)
            {
                return;
            }

            float horizontal = Input.GetAxisRaw(horizontalAxeName);
            float vertical   = Input.GetAxisRaw(verticalAxeName);


            //Check if we have a non-zero value for horizontal or vertical
            if (horizontal != 0 || vertical != 0)
            {
                animator.SetBool("move", true);
                horizontal = horizontal * moveSpeed * Time.deltaTime;
                vertical   = vertical * moveSpeed * Time.deltaTime;

                Move(horizontal, vertical);
            }
            else
            {
                animator.SetBool("move", false);
            }
            RotatePlayer(horizontal, vertical);

            CameraHandler camerahandler = GameObject.FindGameObjectWithTag("MazeCamera").GetComponent <CameraHandler>();

            camerahandler.SetPlayerPosition(transform.position);
        }
Esempio n. 2
0
        void SetCamSize(int sizeMap)
        {
            CameraHandler cam = GameObject.FindGameObjectWithTag("MazeCamera").GetComponent <CameraHandler>();

            cam.setMapSize(sizeMap);
        }