コード例 #1
0
 public void PickupWeapon(int index)
 {
     // If I don't have weapon, pick it up
     if (!HasWeapon(index))
     {
         if (characterMesh.activeSelf == false)
         {
             characterMesh.SetActive(true);
         }
         switchController.inventoryWeapons[index].locked = false;
         switchController.SwitchCurrentWeapon(index);
         // Otherwise increase ammo
     }
     else
     {
         UpdateAmmoPool(weapons[index].weaponPrefab.clipsize, index);
     }
 }