//实现父类
 /// <summary>
 /// 初始化数据
 /// </summary>
 void InitData()
 {
     currentInventory = null;
     countText        = transform.Find("Count").GetComponent <Text>();
     inventoryImage   = transform.Find("Inventory").GetComponent <Image>();
     //初始化图片隐藏
     countText.gameObject.SetActive(!this.gameObject.active);
     inventoryImage.gameObject.SetActive(!this.gameObject.active);
 }
示例#2
0
 /// <summary>
 /// 设置当前item
 /// </summary>
 /// <param name="item"></param>
 public void SetCurrentInventoryItem(InventoryItem item, EquipItemUI equipItemUI)
 {
     if (item == null)
     {
         return;
     }
     this.currentInventory = item;
     currentEquipItemUI    = equipItemUI;
     DisPlayEquipInfo(currentInventory);
 }
示例#3
0
 /// <summary>
 /// 设置当前item
 /// </summary>
 /// <param name="item"></param>
 public void SetCurrentInventoryItem(InventoryItem item, InventoryItemUI itemUI)
 {
     if (item == null)
     {
         return;
     }
     this.currentInventory   = item;
     this.currentInventoryUI = itemUI;
     DisPlayInventoryInfo(currentInventory);
 }
示例#4
0
 //查找当前元素
 /// <summary>
 /// 设置当前格子的物品信息
 /// </summary>
 /// <param name="item"></param>
 public void SetCurrentInventory(InventoryItem item)
 {
     if (item == null)
     {
         return;
     }
     this.currentInventory           = item;
     this.currentInventory.IsDressed = true;//表示当前装备的已经穿上的标记
     isDressed = true;
     itemImage.gameObject.SetActive(true);
     itemImage.sprite = TextureAltlers.Instance.textureArray[int.Parse(currentInventory.Inventory.ICON)];
 }
        //查找当前元素

        public void SetCurrentInventory(InventoryItem item)
        {
            currentInventory = item;
            inventoryImage.gameObject.SetActive(true);
            countText.gameObject.SetActive(true);
            inventoryImage.sprite = TextureAltlers.Instance.textureArray[int.Parse(currentInventory.Inventory.ICON)];
            if (currentInventory.Count > 1)
            {
                countText.text = currentInventory.Count.ToString();
            }
            else
            {
                countText.text = "";
            }
        }
示例#6
0
 public void Clear()
 {
     currentInventory = null;
     itemImage.gameObject.SetActive(false);
     this.isDressed = false;
 }
 public void Clear()
 {
     currentInventory = null;
     inventoryImage.gameObject.SetActive(false);
     countText.gameObject.SetActive(false);
 }