示例#1
0
文件: UIShopItem.cs 项目: bradur/LD44
 public void Init(InventoryItem item)
 {
     txtName.text   = item.WeaponConfig.Name;
     imgIcon.sprite = item.WeaponConfig.PreviewPicture;
     rectTransform  = GetComponent <RectTransform>();
     if (!item.UnlimitedAmmo)
     {
         imgAmmoIcon.sprite = item.WeaponConfig.Projectile.PreviewPicture;
         SetAmmo(item.Ammo);
         buyAmmoButton.Init(this, item);
     }
     else
     {
         imgAmmoIcon.enabled = false;
         buyAmmoButton.gameObject.SetActive(false);
         txtAmmoCount.text = "";
     }
     txtDamage.text = item.WeaponConfig.Projectile.Damage.ToString();
     buyButton.Init(this, item);
     inventoryItem = item;
 }