예제 #1
0
    public void OnInventoryClick(object[] objectArray)
    {
        InventoryItem it     = objectArray[0] as InventoryItem;
        bool          isLeft = (bool)objectArray[1];

        if (it.Inventory.InventoryTYPE == InventoryType.Equip)
        {
            InventoryItemUI   itUI      = null;
            KnapsackRoleEquip roleEquip = null;
            if (isLeft == true)
            {
                itUI = objectArray[2] as InventoryItemUI;
            }
            else
            {
                roleEquip = objectArray[2] as KnapsackRoleEquip;
            }
            inventoryPoup.Close();
            equipPopup.Show(it, itUI, roleEquip, isLeft);
        }
        else
        {
            InventoryItemUI itUI = objectArray[2] as InventoryItemUI;
            equipPopup.Close();
            inventoryPoup.Show(it, itUI);
        }

        if ((it.Inventory.InventoryTYPE == InventoryType.Equip && isLeft == true) || it.Inventory.InventoryTYPE != InventoryType.Equip)
        {
            this.itUI = objectArray[2] as InventoryItemUI;
            EnableButton();
            priceLabel.text = (this.itUI.it.Inventory.Price * this.itUI.it.Count).ToString();
        }
    }
예제 #2
0
    public void OnInventoryClick(object[] objArr)
    {
        InventoryItem it     = objArr [0] as InventoryItem;
        bool          isLeft = (bool)objArr [1];

        if (it._Item._InventoryType == InventoryType.Equip)
        {
            InventoryItemUI itUI = null;
            BagRoleEquip    bre  = null;
            if (isLeft == true)
            {
                itUI = objArr [2] as InventoryItemUI;
            }
            else
            {
                bre = objArr[2] as BagRoleEquip;
            }
            inventoryPopup.Close();
            equipPopup.Show(it, itUI, bre, isLeft);
        }
        else
        {
            InventoryItemUI itUI = objArr[2] as InventoryItemUI;
            equipPopup.Close();
            inventoryPopup.Show(it, itUI);
        }
        if ((it._Item._InventoryType == InventoryType.Equip && isLeft == true) || it._Item._InventoryType != InventoryType.Equip)
        {
            this.it = it;
            EnableBtn();
        }
    }
예제 #3
0
    void OnSale()
    {
        int price = int.Parse(pricesale.text);

        PlayInfo._instance.AddCoin(price);
        InventoryManager._instance.RemoveInventoryItem(itUI.it);
        itUI.Clear();
        equip.close();
        inventory.Close();
        InventoryUI._instance.SendMessage("UpdateCount");
    }
예제 #4
0
    //
    public void OnInventoryClick(object[] o)
    {
        //Debug.Log("OnEquipClick");
        InventoryItem it     = o[0] as InventoryItem;
        bool          isLeft = (bool)(o[1]);
        //Debug.Log(isLeft);

        InventoryItemUI       itui = null;
        KnapsackRoleEquipItem eit  = null;

        if (it.Inventory.InventoryTYPE == InventoryType.Equip)
        {
            if (isLeft)
            {
                itui = o[2] as InventoryItemUI;
            }
            else
            {
                eit = o[2] as KnapsackRoleEquipItem;
            }

            equipPopup.Show(it, itui, eit, isLeft);
            inventoryPopup.Close();
        }
        else
        {
            itui = o[2] as InventoryItemUI;
            inventoryPopup.Show(it, itui);
            equipPopup.Close();
        }

        //可以出售的情况
        if (isLeft == true)
        {
            EnableSellBtn();
            this.itui = o[2] as InventoryItemUI;

            sellPriceLabel.text = (this.itui.it.Inventory.Price * this.itui.it.Count).ToString();
        }
    }
예제 #5
0
    /// <summary>
    /// 物品点击事件。被点击的物品上传到这里,KnapsackRoleEquip和InventoryItemUI里面的OnPress(sendmessage过来的)
    /// </summary>
    /// <param name="objArray"></param>
    public void OnInventoryClick(object[] objArray)
    {
        InventoryItem it = objArray[0] as InventoryItem;    //被电击的物品

        bool isLeft = (bool)objArray[1];

        if (it.inventory.InventoryTYPE == InventoryType.Equip)
        {
            InventoryItemUI   itUi   = null;
            KnapsackRoleEquip itRole = null;
            if (isLeft == true) //背包中装备
            {
                itUi = objArray[2] as InventoryItemUI;
            }
            else        //role中装备
            {
                itRole = objArray[2] as KnapsackRoleEquip;
            }
            equipPopup.Show(it, itUi, itRole, isLeft);    //show将点击的inventoryUI传进来
            inventoryPopup.Close();
        }
        else
        {
            InventoryItemUI itUI = objArray[2] as InventoryItemUI;
            inventoryPopup.Show(it, itUI);
            equipPopup.Close();
        }

        if (isLeft)    //不是role中点击的
        {
            this.itUI = objArray[2] as InventoryItemUI;
            EnableBUtn();
            priceLabel.text = "售价" + this.itUI.it.inventory.Price * this.itUI.it.Count;
        }
        else
        {
            upgradeButton.isEnabled = false;
        }
    }
예제 #6
0
 private void OnCloseInventory()
 {
     inventoryPopup.Close();
 }