private void PickupAssaultRifleAmmo() { m_Ammo.AddAmmo(Constants.AssaultRifle, 50); GameUi.SetPickupText("Assault rifle ammo picked up + 50 ammo"); if (m_GunEquipper.GetActiveWeapon().CompareTag(Constants.AssaultRifle)) { GameUi.SetAmmoText(m_Ammo.GetAmmoCount(Constants.AssaultRifle)); } }
public AmmoData Serialize(Ammo ammo) { var ammoData = new AmmoData(); ammoData.ammoCount = ammo.GetAmmoCount(); ammoData.slotUiIndex = ammo.GetItemUi().GetItemUiSlotIndex(); return(ammoData); }
private void LoadWeapon(GameObject weapon) { Pistol.SetActive(false); AssaultRifle.SetActive(false); Shotgun.SetActive(false); weapon.SetActive(true); m_ActiveGun = weapon; m_GameUi.SetAmmoText(m_Ammo.GetAmmoCount(m_ActiveGun.tag)); }