Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 public void SetWeaponAmmo(Constants.Guns gunType, int count)
 {
     foreach (GUIWeapon gUIWeapon in Weapons)
     {
         if (gUIWeapon.GunType == gunType)
         {
             gUIWeapon.SetAmmoCount(count);
         }
     }
 }
Esempio n. 3
0
 public void SetWeaponAcive(Constants.Guns gunType, bool active)
 {
     foreach (GUIWeapon gUIWeapon in Weapons)
     {
         if (gUIWeapon.GunType == gunType)
         {
             gUIWeapon.SetWeaponActive(active);
         }
     }
 }
Esempio n. 4
0
 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);
         }
     }
 }