private void PickUpThrowable(GameObject throwableToPickUp) { weaponBeingHeld = throwableToPickUp.GetComponent <WeaponPickup>().GetWeapon(); weaponBeforeChallenge = weaponBeingHeld; shotSound = weaponBeingHeld.GetShotSound(); bulletTypeImage.sprite = weaponBeingHeld.GetBulletTypeImage(); hatImage.sprite = weaponBeingHeld.GetHatImage(); hatAnimator.SetTrigger(RESET_HAT_TRIGGER); currentBulletManager = throwableToPickUp.GetComponent <BulletManager>(); tipOfTheGun.transform.localPosition = weaponBeingHeld.GetGunTip().transform.localPosition; shootingPS = Instantiate(weaponBeingHeld.GetFiringParticleSystem(), tipOfTheGun.position, Quaternion.identity, transform); OnItemPickup(currentBulletManager.AvailableBulletsCount()); isHoldingThrowable = true; nextShotAvailable = true; spriteRenderer.sprite = weaponBeingHeld.GetSprite(); }
public int GetRemainingBullets() { return(currentBulletManager.AvailableBulletsCount()); }