void Clear() { if (inventoryItemUI != null) { inventoryItemUI = null; } if (inventory != null) { inventory = null; } if (roleEquip != null) { roleEquip.Clear(); } }
//点击御下和装备按钮触发 public void OnEquip() { int starValue = PlayerInfo.Intance.GetOverailPower(); if (isLeft) { itUI.Clear(); //清空该装备所在的格子 PlayerInfo.Intance.DressOn(it); //从背包装备到身上 } else { roleEquip.Clear(); //把身上的装备清空 PlayerInfo.Intance.DressOff(it); //从身上脱下 } int endValue = PlayerInfo.Intance.GetOverailPower(); powerShow.ShowPowerChange(starValue, endValue); InventoryUI._instance.SendMessage("UpdateCount"); OnClose(); }
void onequip() { int startvalue = PlayInfo._instance.GetOverallPower(); if (isleft) { if (it.Isdressed == true) { close(); return; } if (it.Inventory.InventoryType == InventoryType.Equip) { itUI.Clear();//清空装备身上的各种 PlayInfo._instance.DressOn(it); } if (it.Inventory.InventoryType == InventoryType.PetEquip) { //------------------------------宠物------------------ - itUI.Clear();//清空装备身上的各种 PetInfo._petInstance.PetDressOn(it); } //-------------------------通知UIPetManager激活宠物模型UI---------------------------- if (it.Inventory.InventoryType == InventoryType.Pet) //如果点击背包里面的东西类型是宠物 { if (it.Inventory.Name == "烈焰狂狮" && UIPetManager._uiPetManager.isHaveLion == false) //当狮子宠物不存在的时候 { itUI.Clear(); //清除背包宠物UI isUILion = true; //如果点击的是狮子 UIPetManager._uiPetManager.CreatPet(); //调用宠物UI模型的激活 } if (it.Inventory.Name == "小精灵" && UIPetManager._uiPetManager.isHaveElf == false) { itUI.Clear(); isUIElf = true; UIPetManager._uiPetManager.CreatPet(); } if (it.Inventory.Name == "小仙女" && UIPetManager._uiPetManager.isHaveFairy == false) { itUI.Clear(); isUIFairy = true; UIPetManager._uiPetManager.CreatPet(); } } } else { if (it.Isdressed == false) { close(); return; } roleEquip.Clear(); if (it.Inventory.InventoryType == InventoryType.Equip) { PlayInfo._instance.DressOff(it); } //------------------------------- if (it.Inventory.InventoryType == InventoryType.PetEquip) { PetInfo._petInstance.PetDressOff(it); } } int endvalue = PlayInfo._instance.GetOverallPower(); powershow.ShowPowerChange(startvalue, endvalue); InventoryUI._instance.SendMessage("UpdateCount"); close(); }