Exemplo n.º 1
0
 private void HandlePickup()
 {
     if (Input.GetButtonDown(XboxController.GetButtonName(pickupButton) + playerNumber) && !isCarrying)
     {
         GameObject item = pickUpVolume.PickupItem();
         if (item != null)
         {
             pickedUpItem = item;
             pickedUpItem.transform.parent        = itemLocation.transform;
             pickedUpItem.transform.localPosition = Vector3.zero;
             pickedUpItem.GetComponent <PickUpItem>().HoldItem(true);
             isCarrying = true;
         }
         else
         {
             pickedUpItem = null;
             isCarrying   = false;
         }
     }
     else if (Input.GetButtonDown(XboxController.GetButtonName(pickupButton) + playerNumber) && isCarrying)
     {
         pickedUpItem.transform.parent = null;
         pickedUpItem.GetComponent <PickUpItem>().HoldItem(false);
         pickedUpItem = null;
         isCarrying   = false;
     }
 }
Exemplo n.º 2
0
 private void HandleWeapons()
 {
     if (canRangeAttack && Input.GetAxisRaw(XboxController.GetButtonName(shootButton) + playerNumber) > 0.0f)
     {
         Shoot();
     }
 }
Exemplo n.º 3
0
 private void HandleJumping()
 {
     if (IsOnGround())
     {
         ;
         if (Input.GetAxisRaw(XboxController.GetButtonName(jumpButton) + playerNumber) > 0)
         {
             moveVelocity.y = 1;
         }
     }
     else
     {
         moveVelocity.y = 0;
     }
 }
Exemplo n.º 4
0
 private void HandleMelee()
 {
     if (canMeleeAttack && Input.GetAxisRaw(XboxController.GetButtonName(meleeButton) + playerNumber) > 0.0f)
     {
     }
 }