Ejemplo n.º 1
0
        private void OnMove(GameEventBase gameEventBase)
        {
            InputMoveGameEvent inputMoveGameEvent = (InputMoveGameEvent)gameEventBase;

            switch (inputMoveGameEvent.MoveDir)
            {
            case MoveDir.Left:
                GameEntry.Camera.SetCameraRotate(0, inputMoveGameEvent.Speed);
                break;

            case MoveDir.Right:
                GameEntry.Camera.SetCameraRotate(1, inputMoveGameEvent.Speed);
                break;

            case MoveDir.Up:
                GameEntry.Camera.SetCameraUpAndDown(1);
                break;

            case MoveDir.Down:
                GameEntry.Camera.SetCameraUpAndDown(0);
                break;
            }
            Vector3 targetDir = deltaVec;

            targetDir = targetDir.GetRotateY(GameEntry.Camera.MainCamera.transform.eulerAngles.y);

            m_MoveComponent.ChangeSetInputMoveDirection(targetDir);
        }
Ejemplo n.º 2
0
        private void OnSceneMove(GameEventBase gameEventBase)
        {
            InputMoveGameEvent inputMoveGameEvent = (InputMoveGameEvent)gameEventBase;

            switch (inputMoveGameEvent.MoveDir)
            {
            case MoveDir.Left:
                if (TranCam != null)
                {
                    TranCam.Rotate(0, -inputMoveGameEvent.Speed * Time.deltaTime, 0);
                    if (TranCam.localEulerAngles.y > 180)
                    {
                        TranCam.localEulerAngles = new Vector3(0, Mathf.Clamp(TranCam.localEulerAngles.y, 330f, 360f), 0);
                    }
                    else
                    {
                        TranCam.localEulerAngles = new Vector3(0, Mathf.Clamp(TranCam.localEulerAngles.y, 0, 30f), 0);
                    }
                }

                break;

            case MoveDir.Right:
                if (TranCam != null)
                {
                    TranCam.Rotate(0, inputMoveGameEvent.Speed * Time.deltaTime, 0);
                    if (TranCam.localEulerAngles.y > 180)
                    {
                        TranCam.localEulerAngles = new Vector3(0, Mathf.Clamp(TranCam.localEulerAngles.y, 330f, 360f), 0);
                    }
                    else
                    {
                        TranCam.localEulerAngles = new Vector3(0, Mathf.Clamp(TranCam.localEulerAngles.y, 0, 30f), 0);
                    }
                }
                break;

            case MoveDir.Up:
                break;

            case MoveDir.Down:
                break;
            }
        }