//宠物物品列表.. private static void msg_SC_PET_BAG_NTF(int iMsgID, ref CMessage msg) { CliProto.SC_PET_BAG_NTF refMsg = (CliProto.SC_PET_BAG_NTF)msg; SDGlobal.Log("<- SCID_PET_BAG_NTF : "); sdNewPetMgr.Instance.petItemDB.Clear(); int count = refMsg.m_Items.m_ItemCount; for (int i = 0; i < count; ++i) { sdNewPetMgr.Instance.createItem((int)refMsg.m_Items.m_Items[i].m_TID, (UInt64)refMsg.m_Items.m_Items[i].m_UID, (int)refMsg.m_Items.m_Items[i].m_CT); } GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUIPetEquipPnl petEquipPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>(); if (petEquipPnl) { petEquipPnl.RefreshPetItemListPage(); } sdUIPetChangeEquipPnl petEquipPnl2 = wnd.GetComponentInChildren <sdUIPetChangeEquipPnl>(); if (petEquipPnl2) { petEquipPnl2.RefreshPetItemListPage(); } } }
//宠物装备.. public void ActivePetEquipPnl(GameObject PreWnd) { if (m_UIPetEquipPnl == null) { sdUILoading.ActiveSmallLoadingUI(true); ResLoadParams param = new ResLoadParams(); param.userdata0 = PreWnd as object; sdResourceMgr.Instance.LoadResource("UI/PetSys/$PetEquipPnl.prefab", LoadPetEquipPnl, param); return; } if (PreWnd) { PreWnd.SetActive(false); } CloseAllPetPnl(); m_UIPetEquipPnl.SetActive(true); m_UIPetEquipPnl.transform.parent = sdGameLevel.instance.UICamera.transform; m_UIPetEquipPnl.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f); m_UIPetEquipPnl.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f); sdUIPetEquipPnl obj = m_UIPetEquipPnl.GetComponentInChildren <sdUIPetEquipPnl>(); if (obj != null) { obj.Init(); obj.ActivePetEquipPnl(PreWnd); } }
//宠物物品单件得到或者更新属性.. private static void msg_SC_PET_BAG_SINGLE_ENTER_NTF(int iMsgID, ref CMessage msg) { CliProto.SC_PET_BAG_SINGLE_ENTER_NTF refMsg = (CliProto.SC_PET_BAG_SINGLE_ENTER_NTF)msg; SDGlobal.Log("<- SCID_PET_BAG_SINGLE_ENTER_NTF : "); sdNewPetMgr.Instance.addOrUpdatePetItem(refMsg.m_Item.m_TID, refMsg.m_Item.m_UID, refMsg.m_Item.m_CT); GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUIPetEquipPnl petEquipPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>(); if (petEquipPnl) { petEquipPnl.RefreshPetItemListPage(); } sdUIPetChangeEquipPnl petEquipPnl2 = wnd.GetComponentInChildren <sdUIPetChangeEquipPnl>(); if (petEquipPnl2) { petEquipPnl2.RefreshPetItemListPage(); } } }
void OnClickSale() { GameObject wnd = GameObject.Find("NGUIRoot"); if (wnd) { sdUIPetEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>(); if (petPnl) { foreach (DictionaryEntry info in petPnl.petItemList) { sdUIPetEquipIcon icon = info.Value as sdUIPetEquipIcon; if (icon != null) { UInt64 uuID = icon.GetId(); if (uuID != UInt64.MaxValue && icon.bSelect == true) { sdPetMsg.Send_CS_PET_EVENT_REQ((byte)HeaderProto.EPetEvent.PET_ITEM_EVENT_SELL, uuID); } } } } } }
void OnClick() { if (gameObject.name == "BT_petClose") { if (sdUIPetControl.m_UIPetEquipPnl != null) { sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetEquipPnl); if (!sdUIPetControl.Instance.IsReturnLevelPrepare()) { sdUIPetEquipPnl obj = sdUIPetControl.m_UIPetEquipPnl.GetComponent <sdUIPetEquipPnl>(); if (obj != null && obj.m_preWnd != null) { obj.m_preWnd.SetActive(true); } } } } else if (gameObject.name == "tab2_all") { GameObject wnd = GameObject.Find("NGUIRoot"); if (wnd) { sdUIPetEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>(); if (petPnl) { petPnl.m_Type = PetEquipType.Pet_EquipType_all; petPnl.RefreshPetItemListPage(); } } } else if (gameObject.name == "tab2_armor") { GameObject wnd = GameObject.Find("NGUIRoot"); if (wnd) { sdUIPetEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>(); if (petPnl) { petPnl.m_Type = PetEquipType.Pet_EquipType_fj; petPnl.RefreshPetItemListPage(); } } } else if (gameObject.name == "tab2_shipin") { GameObject wnd = GameObject.Find("NGUIRoot"); if (wnd) { sdUIPetEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>(); if (petPnl) { petPnl.m_Type = PetEquipType.Pet_EquipType_sp; petPnl.RefreshPetItemListPage(); } } } else if (gameObject.name == "tab2_weapon") { GameObject wnd = GameObject.Find("NGUIRoot"); if (wnd) { sdUIPetEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>(); if (petPnl) { petPnl.m_Type = PetEquipType.Pet_EquipType_wq; petPnl.RefreshPetItemListPage(); } } } else if (gameObject.name == "btnSale") { GameObject wnd = GameObject.Find("NGUIRoot"); if (wnd) { sdUIPetEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>(); if (petPnl) { foreach (DictionaryEntry info in petPnl.petItemList) { sdUIPetEquipIcon icon = info.Value as sdUIPetEquipIcon; if (icon != null) { UInt64 uuID = icon.GetId(); if (uuID != UInt64.MaxValue && icon.bSelect == true) { sdMsgBox.OnConfirm btn_sale = new sdMsgBox.OnConfirm(OnClickSale); sdUICharacter.Instance.ShowOkCanelMsg("您确定要将已选择的宠物装备出售么?", btn_sale, null); break; } } } } } } else if (gameObject.name == "sort_value") { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUIPetEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>(); if (petPnl) { if (petPnl.m_iSortType != (int)PetItemSortType.PetItem_SortBy_Value) { petPnl.m_iSortType = (int)PetItemSortType.PetItem_SortBy_Value; petPnl.RefreshPetItemListPage(); } } } } else if (gameObject.name == "sort_color") { GameObject wnd = sdGameLevel.instance.NGUIRoot; if (wnd) { sdUIPetEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>(); if (petPnl) { if (petPnl.m_iSortType != (int)PetItemSortType.PetItem_SortBy_Color) { petPnl.m_iSortType = (int)PetItemSortType.PetItem_SortBy_Color; petPnl.RefreshPetItemListPage(); } } } } }