private void CheckAmmoType() { // Checks if the ammo has been collected if (!BL_AmmoCollected) { switch (in_ammoType) { case 1: // Calls the ammo collection method PB.AmmoCollection(in_ammoType, in_ammoAmount); // Locks the method so that it is only called once BL_AmmoCollected = true; break; case 2: // Calls the ammo collection method PB.AmmoCollection(in_ammoType, in_ammoAmount); // Locks the method so that it is only called once BL_AmmoCollected = true; break; case 3: // Calls the ammo collection method PB.AmmoCollection(in_ammoType, 1); // Locks the method so that it is only called once BL_AmmoCollected = true; break; } } else { // Destroys the game object Destroy(gameObject); } }