private void HandlePlayerClick() { if (uIManager.UIShown) { return; } RaycastHit hit = raycast.GetHitObject(); if (equipper.EquippedItem != null && equipper.EquippedItem.Properties.Consumable) // Consume the item { } else if (hit.collider != null && hit.collider.CompareTag("Inventory")) // Pickup item { } else // Swing item { if (!playerStatistics.StaminaCooldown) // if the player isn't on stamina cooldown { anim.SetInteger("activeState", 5); GetComponentInChildren <RotateOnFire>().SetDoRotate(true); currentSwingTime = 0; hasActivatedSwingEffect = false; isSwinging = true; // Removes stamina on swing playerStatistics.ChangePlayerStamina(-1 * swingStaminaRequired); } } }