private void AddAmmo(WeaponSlot weapon, int quantity) { weapon.Ammo += quantity; var weaponEquiped = GameObject.FindGameObjectWithTag("Weapon"); if (weaponEquiped != null) { weaponEquiped.GetComponent <Weapon>().AddAmmo(quantity); } weapon.RenderWeapon(); }