Пример #1
0
 public static void SelectWeapon(int number)         // select specific weapon by its index
 {
     if (weapons.Count != 0)
     {
         playerStats  = GameObject.Find("SavePlayerStats").GetComponent <SavePlayerStats> ();
         weaponNumber = number;
         if (weaponNumber >= weapons.Count)
         {
             weaponNumber = 0;
         }
         WeaponScript currWeapon = weapons[weaponNumber] as WeaponScript;
         playerStats.WeaponPickUp(currWeapon);
     }
     //ChangeHudText ();
 }
Пример #2
0
 public static void SelectWeaponRanged(int number)
 {
     if (rangedWeapons.Count != 0)
     {
         playerStats        = GameObject.Find("SavePlayerStats").GetComponent <SavePlayerStats> ();
         rangedWeaponNumber = number;
         if (rangedWeaponNumber >= rangedWeapons.Count)
         {
             rangedWeaponNumber = 0;
         }
         WeaponScript currWeapon = rangedWeapons[rangedWeaponNumber] as WeaponScript;
         //playerStats.rangedWeapons.Add (currWeapon);
         playerStats.WeaponPickUp(currWeapon);
     }
     //ChangeHudText ();
 }