示例#1
0
    public void OnInventoryClick(object[] array)  //当装备被点击的时候,显示装备信息面板
    {
        InventoryItem it     = (InventoryItem)array[0];
        bool          isLeft = (bool)array[1];

        if (it.Inventory.InvenType == InventoryType.Equip)
        {
            KnapsackItem  ki = null;
            KnapsackEquip ke = null;
            if (isLeft)
            {
                ki = (KnapsackItem)array[2];
            }
            else
            {
                ke = (KnapsackEquip)array[2];
            }
            inventory.OnCloseBtnClick();  //保证另一个窗口已经关闭
            equipment.ShowInfo(it, ki, ke, isLeft);
        }
        else
        {
            KnapsackItem ki = (KnapsackItem)array[2];
            equipment.OnCloseBtnClick();  //保证另一个窗口已经关闭
            inventory.ShowInfo(it, ki);
        }

        if ((it.Inventory.InvenType == InventoryType.Equip && isLeft == true) || it.Inventory.InvenType != InventoryType.Equip)
        {
            //在背包里点击装备出售或者点击其他物品 人物穿戴的装备不可出售
            ki = (KnapsackItem)array[2];
            ShowBtn();
            priceLabel.text = ki.it.Inventory.Price * ki.it.Num + "";
        }
    }