Ejemplo n.º 1
0
    //宠物物品列表..
    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();
            }
        }
    }
Ejemplo n.º 2
0
    void OnClick()
    {
        if (gameObject)
        {
            //换装备界面武器防具等,同时只能选中一件..
            if (bSelect == false && equipUID != UInt64.MaxValue)
            {
                sdGamePetItem petItem = sdNewPetMgr.Instance.getPetItem(equipUID);
                if (petItem != null)
                {
                    GameObject wnd = sdGameLevel.instance.NGUIRoot;
                    if (wnd)
                    {
                        sdUIPetChangeEquipPnl cePnl = wnd.GetComponentInChildren <sdUIPetChangeEquipPnl>();
                        if (cePnl)
                        {
                            cePnl.SetAllItemUnSelectByCharacter(petItem.iCharacter);
                        }
                    }
                }
            }

            bSelect = !bSelect;
            ReflashSelectUI();
        }
    }
Ejemplo n.º 3
0
    //宠物更换装备面板..
    public void ActivePetChangeEquipPnl(GameObject PreWnd, UInt64 uuDBID, int iSortSubClass)
    {
        if (m_UIPetChangeEquipPnl == null)
        {
            sdUILoading.ActiveSmallLoadingUI(true);

            ResLoadParams param = new ResLoadParams();
            param.petData0 = uuDBID.ToString();
            param.petInt   = iSortSubClass;
            sdResourceMgr.Instance.LoadResource("UI/PetSys/$PetChangeEquipPnl.prefab", LoadPetChangeEquipPnl, param);
            return;
        }

        if (PreWnd)
        {
            PreWnd.SetActive(false);
        }

        m_UIPetChangeEquipPnl.SetActive(true);
        m_UIPetChangeEquipPnl.transform.parent        = sdGameLevel.instance.UICamera.transform;
        m_UIPetChangeEquipPnl.transform.localScale    = new Vector3(1.0f, 1.0f, 1.0f);
        m_UIPetChangeEquipPnl.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f);

        sdUIPetChangeEquipPnl obj = m_UIPetChangeEquipPnl.GetComponentInChildren <sdUIPetChangeEquipPnl>();

        if (obj != null)
        {
            obj.Init();
            obj.ActivePetChangeEquipPnl(PreWnd, uuDBID, iSortSubClass);
        }
    }
Ejemplo n.º 4
0
    public void ActivePetChangeEquipPnl(GameObject PreWnd, UInt64 uuDBID, int iSortSubClass)
    {
        GameObject wnd = GameObject.Find("NGUIRoot");

        if (wnd)
        {
            sdUIPetChangeEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetChangeEquipPnl>();
            if (petPnl)
            {
                petPnl.m_uuSelectDBID  = uuDBID;
                petPnl.m_iSortSubClass = iSortSubClass;
                petPnl.ReflashPetIcon();
                petPnl.ReflashPetEquipUI();
                petPnl.RefreshPetItemListPage();
            }
        }
    }
Ejemplo n.º 5
0
    //宠物物品单件得到或者更新属性..
    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();
            }
        }
    }
Ejemplo n.º 6
0
    //宠物属性更新..
    private static void msg_SCID_SINGLE_ENTER_NTF(int iMsgID, ref CMessage msg)
    {
        CliProto.SC_PET_SINGLE_ENTER_NTF refMsg = (CliProto.SC_PET_SINGLE_ENTER_NTF)msg;
        sdNewPetMgr.Instance.UpdatePetInfo(refMsg);

        GameObject wnd = sdGameLevel.instance.NGUIRoot;

        if (wnd)
        {
            sdUIPetListPnl petListPnl = wnd.GetComponentInChildren <sdUIPetListPnl>();
            if (petListPnl)
            {
                petListPnl.RefreshPetListPage();
            }

            sdUIPetPropPnl petPropPnl = wnd.GetComponentInChildren <sdUIPetPropPnl>();
            if (petPropPnl)
            {
                petPropPnl.ReflashPetPropUI();
            }

//			sdUIPetLevelPnl petLevelPnl = wnd.GetComponentInChildren<sdUIPetLevelPnl>();
//			if (petLevelPnl && bPetLeveling==false)
//			{
//				if (bPetLeveling==false)
//					petLevelPnl.ReflashPetLevelUI();
//				bPetLeveling = false;
//			}

            sdUIPetChangeEquipPnl petCEquipPnl = wnd.GetComponentInChildren <sdUIPetChangeEquipPnl>();
            if (petCEquipPnl)
            {
                petCEquipPnl.ReflashPetEquipUI();
            }
        }
    }
Ejemplo n.º 7
0
    void OnClick()
    {
        if (gameObject.name == "BT_petClose")
        {
            if (sdUIPetControl.m_UIPetChangeEquipPnl != null)
            {
                sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetChangeEquipPnl);
            }

            if (m_preWnd)
            {
                m_preWnd.SetActive(true);
            }

            GameObject wnd = GameObject.Find("NGUIRoot");
            if (wnd)
            {
                sdUIPetPropPnl petPnl = wnd.GetComponentInChildren <sdUIPetPropPnl>();
                if (petPnl)
                {
                    petPnl.SetPetModelVisible(true);
                }
            }
        }
        else if (gameObject.name == "btnEquip")
        {
            GameObject wnd = GameObject.Find("NGUIRoot");
            if (wnd)
            {
                sdUIPetChangeEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetChangeEquipPnl>();
                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_EQUIP_REQ(uuID, petPnl.m_uuSelectDBID, 1);
                            }
                        }
                    }
                }
            }
        }
        else if (gameObject.name == "btnUnEquip")
        {
            GameObject wnd = GameObject.Find("NGUIRoot");
            if (wnd)
            {
                sdUIPetChangeEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetChangeEquipPnl>();
                if (petPnl)
                {
                    SClientPetInfo Info = null;
                    if (petPnl.m_uuSelectDBID != UInt64.MaxValue)
                    {
                        Info = sdNewPetMgr.Instance.GetPetInfo(petPnl.m_uuSelectDBID);
                        if (Info == null)
                        {
                            return;
                        }
                    }
                    else
                    {
                        return;
                    }

                    foreach (DictionaryEntry equipInfo in Info.m_EquipedDB)
                    {
                        sdGamePetItem petItem = (sdGamePetItem)equipInfo.Value;
                        UInt64        uuID    = petItem.instanceID;
                        if (uuID != UInt64.MaxValue)
                        {
                            sdPetMsg.Send_CS_PET_EQUIP_REQ(uuID, petPnl.m_uuSelectDBID, 0);
                        }
                    }
                }
            }
        }
    }