Exemplo n.º 1
0
        private void HandleCharacterInput()
        {
            PlayerCharacterInputs characterInputs = new PlayerCharacterInputs();

            // Build the CharacterInputs struct
            characterInputs.MoveAxisForward = Input.GetAxisRaw(VerticalInput);
            characterInputs.MoveAxisRight   = Input.GetAxisRaw(HorizontalInput);
            characterInputs.CameraRotation  = OrbitCamera.Transform.rotation;
            characterInputs.JumpDown        = Input.GetKeyDown(KeyCode.Space);
            characterInputs.CrouchDown      = Input.GetKeyDown(KeyCode.C);
            characterInputs.CrouchUp        = Input.GetKeyUp(KeyCode.C);
            characterInputs.ChargingDown    = Input.GetKeyDown(KeyCode.Q);

            // Apply inputs to character
            Character.SetInputs(ref characterInputs);
        }