예제 #1
0
 private void Update()
 {
     if (Input.GetButtonDown("Jump") && _characterController.isGrounded)
     {
         _objectMover.Jump(15);
     }
 }
예제 #2
0
        private void Update()
        {
            var inputVector           = new Vector3(Input.GetAxisRaw("Horizontal"), 0, Input.GetAxisRaw("Vertical"));
            var normalizedInputVector = inputVector.normalized;

            _objectMover.MoveHorizontal(normalizedInputVector * moveSpeed);

            if (Input.GetButtonDown("Jump") && _characterController.isGrounded)
            {
                _objectMover.Jump(15);
            }
        }