public void OnCurrentWeaponIndexChanged() { Constants.Guns gunType = (Constants.Guns)syncPropertyAgent.GetPropertyWithName(CURRENT_WEAPON_INDEX).GetIntValue(); if (gunType == 0) { syncPropertyAgent.Modify(CURRENT_WEAPON_INDEX, (int)DefaultGunType); } ActivateWeapon(gunType); }
public void SetWeaponAmmo(Constants.Guns gunType, int count) { foreach (GUIWeapon gUIWeapon in Weapons) { if (gUIWeapon.GunType == gunType) { gUIWeapon.SetAmmoCount(count); } } }
public void SetWeaponAcive(Constants.Guns gunType, bool active) { foreach (GUIWeapon gUIWeapon in Weapons) { if (gUIWeapon.GunType == gunType) { gUIWeapon.SetWeaponActive(active); } } }
public void ActivateWeapon(Constants.Guns gunType) { foreach (Gun gun in Guns) { if (gun.GunType == gunType) { gun.gameObject.SetActive(true); curretnGun = gun; } else { gun.gameObject.SetActive(false); } } }