private void DoAction_PetEquip() { CObject_Item_Equip pItemEquip = (CObject_Item_Equip)ItemImpl; if (pItemEquip.GetItemClass() != ITEM_CLASS.ICLASS_EQUIP) { return; } int emptyPlace = CDataPool.Instance.UserBag_FindFirstEmptyPlace(); if (emptyPlace == -1) { CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_INFO_SELF, "背包已满,清整理背包后再尝试 ^0^!"); } else { // 发送卸下宠物装备消息. GameObject roleTip = UIWindowMng.Instance.GetWindowGo("RoleTipWindow"); UISelfEquip selfEquip = roleTip.GetComponent <UISelfEquip>(); SDATA_PET curPet = CDataPool.Instance.Pet_GetValidPet(selfEquip.ActivePet);//CDataPool.Instance.Pet_GetPet(selfEquip.ActivePet); if (curPet != null) { CGOperatePetEquip msg = new CGOperatePetEquip(); msg.OperatorType = 1; msg.GUID = curPet.GUID; msg.DestBagIndex = (byte)pItemEquip.GetItemType(); msg.SourecBagIndex = (byte)emptyPlace; NetManager.GetNetManager().SendPacket(msg); } } }
private void DoAction_MyEquip() { // 如果action item在装备栏上. // if(!CDataPool.Instance.Booth_IsClose()) // { // //在修理状态 // if(CActionSystem::GetMe()->GetDefaultAction() == CActionItem_MouseCmd_Repair::GetMe()) // { // //判以下是不是装备,只有装备可以修理 // if(pItem->GetItemClass() == ICLASS_EQUIP) // { // if( pItem->GetItemDur() < pItem->GetItemMaxDur() ) // { // CGameProcedure::s_pGameInterface->Booth_Repair(0, pItem->GetPosIndex(), FALSE); // } // else // { // CEventSystem::GetMe()->PushEvent(GE_INFO_SELF,"此物品不需要修理"); // } // } // } // } // else { CObject_Item_Equip pItemEquip = (CObject_Item_Equip)ItemImpl; if (pItemEquip.GetItemClass() != ITEM_CLASS.ICLASS_EQUIP) { return; } // 发送卸下装备消息. CGUnEquip msg = new CGUnEquip(); msg.EquipPoint = (byte)pItemEquip.GetItemType(); NetManager.GetNetManager().SendPacket(msg); } }