Beispiel #1
0
        void Update()
        {
            float x;
            float z = Input.GetAxis("Vertical") * Time.deltaTime * 3.0f;

            if (Input.GetKeyUp(KeyCode.C))
            {
                SetCamera();
            }

            if (CameraState.Equals(PlayerCameraState.Thirdperson))
            {
                x = Input.GetAxis("Horizontal") * Time.deltaTime * 3.0f;
                transform.Translate(x, 0, z);
                SetPlayerDirection(z, x);
            }
            else if (CameraState.Equals(PlayerCameraState.Firstperson))
            {
                x = Input.GetAxis("Horizontal") * Time.deltaTime * 150.0f;
                transform.Rotate(0, x, 0);
                transform.Translate(0, 0, z);
            }


            _animator.speed = Input.GetAxis("Horizontal") != 0 || Input.GetAxis("Vertical") != 0 ? 3f : 0f;
        }
Beispiel #2
0
 void Update()
 {
     if (cameraState.Equals(CameraState.Default))
     {
         DefaultMove();
     }
 }
Beispiel #3
0
    private void SwitchCameraPhase()
    {
        if (GameTime.IsTimerStart())
        {
            mainCamera.SwitchCameraState();
            CameraState CS = mainCamera.ReturnCameraState();
            if (CS.Equals(CameraState.FREE))
            {
                ButtonText.text = freetext;
            }
            else if (CS.Equals(CameraState.LOCKONHQ))
            {
                ButtonText.text = HQtext;
            }
            else if (CS.Equals(CameraState.LOCKONPLAYER))
            {
                ButtonText.text = Playertext;
            }
        }

        AudioManager.Instance.PlayOneShotEffectClipByName("Button_InGame_Camera", 0.75f);
    }