Ejemplo n.º 1
0
 private void Jumping()
 {
     if (rpgCharacterController.CanStartAction("Jump"))
     {
         if (GUI.Button(new Rect(25, 175, 100, 30), "Jump"))
         {
             rpgCharacterController.SetJumpInput(Vector3.up);
             rpgCharacterController.StartAction("Jump");
         }
     }
 }
Ejemplo n.º 2
0
 void Update()
 {
     if (character != null)
     {
         RPGCharacterController controller = character.GetComponent <RPGCharacterController>();
         controller.SetJumpInput(Vector3.up);
         if (controller.CanStartAction("Jump"))
         {
             controller.StartAction("Jump");
         }
     }
 }
Ejemplo n.º 3
0
        public void Moving()
        {
            moveInput = new Vector3(inputHorizontal, inputVertical, 0f);
            rpgCharacterController.SetMoveInput(moveInput);

            // Set the input on the jump axis every frame.
            Vector3 jumpInput = isJumpHeld ? Vector3.up : Vector3.zero;

            rpgCharacterController.SetJumpInput(jumpInput);

            // If we pressed jump button this frame, jump.
            if (inputJump && rpgCharacterController.CanStartAction("Jump"))
            {
                rpgCharacterController.StartAction("Jump");
            }
        }