示例#1
0
    public void Init(string roleName)
    {
        //int num = 0;
        //ResLoadParams para = new ResLoadParams();
        //para.info = "guide";

        //string namePreb = string.Format("UI/Icon/$guide/guide.prefab", name);
        //sdResourceMgr.Instance.LoadResource(namePreb,SetAtlas,para,typeof(UIAtlas));

        if (isInit)
        {
            return;
        }
        isInit     = true;
        playerName = roleName;
        if (sdConfDataMgr.Instance().GetRoleSetting("NoGuide") == "1")
        {
            return;
        }
        isOperation = true;
        guideList   = sdConfDataMgr.Instance().GetGuideList(playerName);
        //List<sdGuide> list = guideList["1"] as List<sdGuide>;
        if (sdUICharacter.Instance.iCurrentLevelID == 1 && sdConfDataMgr.Instance().GetSetting("FinishGuide") == "1")
        {
            sdUICharacter.Instance.HideFightUi();
            sdMsgBox.OnConfirm ok     = new sdMsgBox.OnConfirm(OnNoGuide);
            sdMsgBox.OnCancel  cancel = new sdMsgBox.OnCancel(OnGetGuideList);
            sdUICharacter.Instance.ShowOkCanelMsg(sdConfDataMgr.Instance().GetShowStr("SkipGuide"), ok, cancel);
            return;
        }

        OnGetGuideList();
    }
示例#2
0
    //世界boss逃跑通知..
    private static void msg_SC_WB_RUN_NTF(int iMsgID, ref CMessage msg)
    {
        CliProto.SC_WB_RUN_NTF refMsg = (CliProto.SC_WB_RUN_NTF)msg;
        Send_CS_WB_RESULT_REQ(0);

        sdMsgBox.OnConfirm btn_ok = new sdMsgBox.OnConfirm(OnClickOk);
        sdUICharacter.Instance.ShowOkMsg("规定时间内世界Boss未被杀死,现在退出么?", btn_ok);
        Time.timeScale = 0.0f;
    }
示例#3
0
 public void PetBeginSale()
 {
     //存在三星以上战魂出售,需要给提示..
     if (IsSelectedWonderfulPet() == true)
     {
         sdMsgBox.OnConfirm btn_ok = new sdMsgBox.OnConfirm(OnClickPetSaleOk);
         sdUICharacter.Instance.ShowOkCanelMsg("你出售的战魂中存在3星以上的战魂,确定出售吗?", btn_ok, null);
     }
     else
     {
         OnClickPetSaleOk();
     }
 }
示例#4
0
 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();
                 }
             }
         }
     }
 }
示例#5
0
    void OnClick()
    {
        if (gameObject.name == "btn_close")
        {
            Time.timeScale = 1.0f;
            mConfigTab.GetComponent <UIDraggablePanel>().ResetPosition();
            sdUICharacter.Instance.HideConfigWnd();
            sdConfDataMgr.Instance().SetSetting("", "");
            if (mGraphicReload)
            {
                sdConfDataMgr.Instance().ApplyGraphicConfig(false);
                mGraphicReload = false;
            }
        }
        else if (gameObject.name == "btn_ok")
        {
            Time.timeScale = 1.0f;
            mConfigTab.GetComponent <UIDraggablePanel>().ResetPosition();
            sdUICharacter.Instance.HideConfigWnd();
            sdConfDataMgr.Instance().SetSetting("", "");
            if (mGraphicReload)
            {
                sdConfDataMgr.Instance().ApplyGraphicConfig(false);
                mGraphicReload = false;
            }
        }
        else if (gameObject.name == "btn_closeF" || gameObject.name == "btn_okF")                       // 战斗config
        {
            Time.timeScale = 1.0f;
            sdUICharacter.Instance.HideConfigWnd();
            sdConfDataMgr.Instance().SetSetting("", "");
        }
        else if (gameObject.name == "btn_ConfigTab")
        {
        }
        else if (gameObject.name == "btn_AccountTab")
        {
            sdUICharacter.Instance.ShowMsgLine(sdConfDataMgr.Instance().GetShowStr("InDevelop"), MSGCOLOR.Yellow);
        }
        else if (gameObject.name == "btn_AboutTab")
        {
            sdUICharacter.Instance.ShowMsgLine(sdConfDataMgr.Instance().GetShowStr("InDevelop"), MSGCOLOR.Yellow);
        }
        else if (gameObject.name == "tg_mute")
        {
            UISprite sp = GetComponentInChildren <UISprite>();
            if (sp.spriteName == "mute0")
            {
                sp.spriteName       = "mute1";
                AudioListener.pause = true;
                mSlider.enabled     = false;
                sdConfDataMgr.Instance().SetSettingNoWrite("CFG_Mute", "1");
            }
            else
            {
                sp.spriteName       = "mute0";
                AudioListener.pause = false;
                mSlider.enabled     = true;
                sdConfDataMgr.Instance().SetSettingNoWrite("CFG_Mute", "0");
            }
        }
        else if (gameObject.name == "tg_g_low")
        {
            if (sdConfDataMgr.Instance().GetSetting("CFG_Graphic") != "0")
            {
                mGraphic1.spriteName = "btn1";
                mGraphic2.spriteName = "btn1dis";
                mGraphic3.spriteName = "btn1dis";
                sdConfDataMgr.Instance().SetSettingNoWrite("CFG_Graphic", "0");
                mGraphicReload = true;
            }
        }
        else if (gameObject.name == "tg_g_mid")
        {
            if (sdConfDataMgr.Instance().GetSetting("CFG_Graphic") != "1")
            {
                mGraphic1.spriteName = "btn1dis";
                mGraphic2.spriteName = "btn1";
                mGraphic3.spriteName = "btn1dis";
                sdConfDataMgr.Instance().SetSettingNoWrite("CFG_Graphic", "1");
                mGraphicReload = true;
            }
        }
        else if (gameObject.name == "tg_g_high")
        {
            if (sdConfDataMgr.Instance().GetSetting("CFG_Graphic") != "2")
            {
                mGraphic1.spriteName = "btn1dis";
                mGraphic2.spriteName = "btn1dis";
                mGraphic3.spriteName = "btn1";
                sdConfDataMgr.Instance().SetSettingNoWrite("CFG_Graphic", "2");
                mGraphicReload = true;
            }
        }
        else if (gameObject.name == "tg_move1")
        {
            if (sdConfDataMgr.Instance().GetSetting("CFG_Move") == "1")
            {
                mControl1.spriteName = "btn1";
                mControl2.spriteName = "btn1dis";
                GameObject.Find("@GameLevel").GetComponent <sdGameLevel>().AutoMode = true;
                sdConfDataMgr.Instance().SetSettingNoWrite("CFG_Move", "0");

                GameObject btn = GameObject.Find("btn_controlmode");
                if (btn != null)
                {
                    btn.GetComponentInChildren <UISprite>().spriteName = "cz1";
                }
            }
        }
        else if (gameObject.name == "tg_move2")
        {
            if (sdConfDataMgr.Instance().GetSetting("CFG_Move") != "1")
            {
                mControl1.spriteName = "btn1dis";
                mControl2.spriteName = "btn1";
                GameObject.Find("@GameLevel").GetComponent <sdGameLevel>().AutoMode = false;
                sdConfDataMgr.Instance().SetSettingNoWrite("CFG_Move", "1");

                GameObject btn = GameObject.Find("btn_controlmode");
                if (btn != null)
                {
                    btn.GetComponentInChildren <UISprite>().spriteName = "cz2";
                }
            }
        }
        else if (gameObject.name == "tg_camera1")
        {
            if (sdConfDataMgr.Instance().GetSetting("CFG_Camera") == "1")
            {
                mCamera1.spriteName = "btn1";
                mCamera2.spriteName = "btn1dis";
                if (sdGameLevel.instance.levelType == sdGameLevel.LevelType.MainCity || sdGameLevel.instance.levelType == sdGameLevel.LevelType.Fight || sdGameLevel.instance.levelType == sdGameLevel.LevelType.None)
                {
                    sdGameLevel.instance.mainCamera.ChangeCameraDistance();
                }
                sdConfDataMgr.Instance().SetSettingNoWrite("CFG_Camera", "0");

                GameObject btn = GameObject.Find("btn_anglemode");
                if (btn != null)
                {
                    btn.GetComponentInChildren <UISprite>().spriteName = "sj1";
                }
            }
        }
        else if (gameObject.name == "tg_camera2")
        {
            if (sdConfDataMgr.Instance().GetSetting("CFG_Camera") != "1")
            {
                mCamera1.spriteName = "btn1dis";
                mCamera2.spriteName = "btn1";
                if (sdGameLevel.instance.levelType == sdGameLevel.LevelType.MainCity || sdGameLevel.instance.levelType == sdGameLevel.LevelType.Fight || sdGameLevel.instance.levelType == sdGameLevel.LevelType.None)
                {
                    sdGameLevel.instance.mainCamera.ChangeCameraDistance();
                }
                sdConfDataMgr.Instance().SetSettingNoWrite("CFG_Camera", "1");

                GameObject btn = GameObject.Find("btn_anglemode");
                if (btn != null)
                {
                    btn.GetComponentInChildren <UISprite>().spriteName = "sj2";
                }
            }
        }
        else if (gameObject.name == "btn_quit")
        {
            sdMsgBox.OnConfirm quit = new sdMsgBox.OnConfirm(OnQuitGame);
            sdUICharacter.Instance.ShowOkCanelMsg(sdConfDataMgr.Instance().GetShowStr("QuitGameConfirm"), quit, null);
        }
        else if (gameObject.name == "btn_back")
        {
            Time.timeScale = 1.0f;
            sdConfDataMgr.Instance().SetSetting("", "");
            if (mTown)
            {
                sdMsgBox.OnConfirm relogin = new sdMsgBox.OnConfirm(OnBackChar);
                sdUICharacter.Instance.ShowOkCanelMsg(sdConfDataMgr.Instance().GetShowStr("ReturnCharComfirm"), relogin, null);
            }
            else
            {
                sdMsgBox.OnConfirm town = new sdMsgBox.OnConfirm(OnBackTown);
                sdUICharacter.Instance.ShowOkCanelMsg(sdConfDataMgr.Instance().GetShowStr("BackTown"), town, null);
            }
        }
        else if (gameObject.name == "btn_default")
        {
            sdMsgBox.OnConfirm btn_default = new sdMsgBox.OnConfirm(OnDefault);
            sdUICharacter.Instance.ShowOkCanelMsg("确定要恢复默认设置吗?", btn_default, null);
        }
        else if (gameObject.name == "tg_head")
        {
            sdUICharacter.Instance.ShowMsgLine(sdConfDataMgr.Instance().GetShowStr("InDevelop"), MSGCOLOR.Yellow);
        }
        else if (gameObject.name == "tg_username")
        {
            sdUICharacter.Instance.ShowMsgLine(sdConfDataMgr.Instance().GetShowStr("InDevelop"), MSGCOLOR.Yellow);
        }
        else if (gameObject.name == "tg_spirit")
        {
            sdUICharacter.Instance.ShowMsgLine(sdConfDataMgr.Instance().GetShowStr("InDevelop"), MSGCOLOR.Yellow);
        }
        else if (gameObject.name == "tg_boss")
        {
            sdUICharacter.Instance.ShowMsgLine(sdConfDataMgr.Instance().GetShowStr("InDevelop"), MSGCOLOR.Yellow);
        }
        else if (gameObject.name == "tg_tianguai")
        {
            sdUICharacter.Instance.ShowMsgLine(sdConfDataMgr.Instance().GetShowStr("InDevelop"), MSGCOLOR.Yellow);
        }
        else if (gameObject.name == "tg_pvp")
        {
            sdUICharacter.Instance.ShowMsgLine(sdConfDataMgr.Instance().GetShowStr("InDevelop"), MSGCOLOR.Yellow);
        }
    }
示例#6
0
 public static void OnWorldBossBeKilled()
 {
     sdMsgBox.OnConfirm btn_ok = new sdMsgBox.OnConfirm(OnClickOk);
     sdUICharacter.Instance.ShowOkMsg("世界Boss已经死亡,现在退出么?", btn_ok);
     Time.timeScale = 0.0f;
 }
示例#7
0
    void OnClick()
    {
        //宠物列表界面..
        if (gameObject.name == "RbZh")
        {
            sdUIPetControl.Instance.ActivePetListPnl(null, false);
        }
        else if (gameObject.name == "RbSp")
        {
            sdUIPetControl.Instance.ActivePetPaperPnl(null);
        }
        else if (gameObject.name == "RbRh")
        {
            sdUIPetControl.Instance.ActivePetRonghePnl(null);
        }
        else if (gameObject.name == "RbTj")
        {
            sdUIPetControl.Instance.ActivePetTujianPnl(null);
        }
        else if (gameObject.name == "petListClose")
        {
            if (sdUIPetControl.m_UIPetListPnl != null)
            {
                WndAni.HideWndAni(sdUIPetControl.m_UIPetListPnl, true, "w_black");
                if (!sdUIPetControl.Instance.IsReturnLevelPrepare())
                {
                    sdUIPetListPnl obj = sdUIPetControl.m_UIPetListPnl.GetComponent <sdUIPetListPnl>();
                    if (obj != null && obj.m_preWnd != null)
                    {
                        obj.m_preWnd.SetActive(true);
                    }
                }
            }

            if (sdUICharacter.Instance.GetTownUI() != null)
            {
                sdUICharacter.Instance.GetTownUI().GetComponent <sdTown>().lockPanel.SetActive(false);
            }
        }
        else if (gameObject.name == "btnPetSale")
        {
            sdUIPetControl.Instance.ActivePetSaleSelectPnl(null);
        }
        else if (gameObject.name == "listSortColor")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetListPnl listPnl = wnd.GetComponentInChildren <sdUIPetListPnl>();
                if (listPnl)
                {
                    if (listPnl.m_iSortType != (int)PetSortType.Pet_SortBy_Color)
                    {
                        listPnl.m_iSortType = (int)PetSortType.Pet_SortBy_Color;
                        listPnl.RefreshPetListPage();
                    }
                }
            }
        }
        else if (gameObject.name == "listSortLevel")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetListPnl listPnl = wnd.GetComponentInChildren <sdUIPetListPnl>();
                if (listPnl)
                {
                    if (listPnl.m_iSortType != (int)PetSortType.Pet_SortBy_Level)
                    {
                        listPnl.m_iSortType = (int)PetSortType.Pet_SortBy_Level;
                        listPnl.RefreshPetListPage();
                    }
                }
            }
        }
        //宠物出售界面..
        else if (gameObject.name == "saleSelectClose")
        {
            if (sdUIPetControl.m_UIPetSaleSelectPnl != null)
            {
                WndAni.HideWndAni(sdUIPetControl.m_UIPetSaleSelectPnl, false, "bg_grey");
                if (!sdUIPetControl.Instance.IsReturnLevelPrepare())
                {
                    sdUIPetSaleSelectPnl obj = sdUIPetControl.m_UIPetSaleSelectPnl.GetComponent <sdUIPetSaleSelectPnl>();
                    if (obj != null && obj.m_preWnd != null)
                    {
                        obj.m_preWnd.SetActive(true);
                    }
                }
            }
        }
        else if (gameObject.name == "btnSaleOk")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetSaleSelectPnl listPnl = wnd.GetComponentInChildren <sdUIPetSaleSelectPnl>();
                if (listPnl)
                {
                    listPnl.PetBeginSale();
                }
            }
        }
        else if (gameObject.name == "SaleOne")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetSaleSelectPnl listPnl = wnd.GetComponentInChildren <sdUIPetSaleSelectPnl>();
                if (listPnl)
                {
                    listPnl.OnClickSaleSelectBtn(1);
                }
            }
        }
        else if (gameObject.name == "SaleTwo")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetSaleSelectPnl listPnl = wnd.GetComponentInChildren <sdUIPetSaleSelectPnl>();
                if (listPnl)
                {
                    listPnl.OnClickSaleSelectBtn(2);
                }
            }
        }
        else if (gameObject.name == "SaleThree")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetSaleSelectPnl listPnl = wnd.GetComponentInChildren <sdUIPetSaleSelectPnl>();
                if (listPnl)
                {
                    listPnl.OnClickSaleSelectBtn(3);
                }
            }
        }
        else if (gameObject.name == "SaleFour")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetSaleSelectPnl listPnl = wnd.GetComponentInChildren <sdUIPetSaleSelectPnl>();
                if (listPnl)
                {
                    listPnl.OnClickSaleSelectBtn(4);
                }
            }
        }
        //宠物碎片合成界面..
        else if (gameObject.name == "petPaperClose")
        {
            if (sdUIPetControl.m_UIPetPaperPnl != null)
            {
                WndAni.HideWndAni(sdUIPetControl.m_UIPetPaperPnl, true, "w_black");
                if (sdUIPetControl.m_UIPetListPnl)
                {
                    WndAni.HideWndAni(sdUIPetControl.m_UIPetListPnl, true, "w_black");
                }
                if (!sdUIPetControl.Instance.IsReturnLevelPrepare())
                {
                    sdUIPetPaperPnl obj = sdUIPetControl.m_UIPetPaperPnl.GetComponent <sdUIPetPaperPnl>();
                    if (obj != null && obj.m_preWnd != null)
                    {
                        obj.m_preWnd.SetActive(true);
                    }
                }
            }

            if (sdUICharacter.Instance.GetTownUI() != null)
            {
                sdUICharacter.Instance.GetTownUI().GetComponent <sdTown>().lockPanel.SetActive(false);
            }
        }
        else if (gameObject.name == "btnPetPaper")
        {
            //数量够,允许合成..
            if (gameObject.transform.FindChild("Background").gameObject.GetComponent <UISprite>().spriteName == "btn_2")
            {
                int iPetId = gameObject.transform.parent.parent.gameObject.GetComponent <sdUIPetPaperCard>().m_iPetID;
                if (iPetId > 0)
                {
                    sdUIPetPaperPnl.m_iNowSelectID = iPetId;
                    int iCurNum = gameObject.transform.parent.parent.gameObject.GetComponent <sdUIPetPaperCard>().m_iCurNum;
                    int iMaxNum = gameObject.transform.parent.parent.gameObject.GetComponent <sdUIPetPaperCard>().m_iMaxNum;
                    if (iCurNum >= iMaxNum && iMaxNum > 0)
                    {
                        Hashtable info = sdConfDataMgr.Instance().GetPetTemplate(iPetId.ToString());
                        if (info != null)
                        {
                            sdMsgBox.OnConfirm btn_ok = new sdMsgBox.OnConfirm(OnClickPetGatherOk);
                            sdUICharacter.Instance.ShowOkCanelMsg("确定要将已有碎片合成么?", btn_ok, null);
                        }
                        else
                        {
                            sdUICharacter.Instance.ShowOkMsg("无效的宠物ID", null);
                        }
                    }
                    else
                    {
                        sdUICharacter.Instance.ShowOkMsg("没有足够的碎片", null);
                    }
                }
            }
            else
            {
                sdUICharacter.Instance.ShowMsgLine("碎片数量不足", Color.yellow);
            }
        }
        //宠物融合界面..
        else if (gameObject.name == "rongheClose")
        {
            if (sdUIPetControl.m_UIPetRonghePnl != null)
            {
                WndAni.HideWndAni(sdUIPetControl.m_UIPetRonghePnl, true, "w_black");
                if (sdUIPetControl.m_UIPetListPnl)
                {
                    WndAni.HideWndAni(sdUIPetControl.m_UIPetListPnl, true, "w_black");
                }
                if (!sdUIPetControl.Instance.IsReturnLevelPrepare())
                {
                    sdUIPetRonghePnl obj = sdUIPetControl.m_UIPetRonghePnl.GetComponent <sdUIPetRonghePnl>();
                    if (obj != null && obj.m_preWnd != null)
                    {
                        obj.m_preWnd.SetActive(true);
                    }
                }
            }

            if (sdUICharacter.Instance.GetTownUI() != null)
            {
                sdUICharacter.Instance.GetTownUI().GetComponent <sdTown>().lockPanel.SetActive(false);
            }
        }
        else if (gameObject.name == "btnRhSel0")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetRonghePnl petPnl = wnd.GetComponentInChildren <sdUIPetRonghePnl>();
                if (petPnl)
                {
                    sdUIPetControl.Instance.ActivePetRongheSelectPnl(null, petPnl.m_uuPetID1, 998);
                    petPnl.ShowHideModel(false);
                }
            }
        }
        else if (gameObject.name == "btnRhSel1")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetRonghePnl petPnl = wnd.GetComponentInChildren <sdUIPetRonghePnl>();
                if (petPnl)
                {
                    sdUIPetControl.Instance.ActivePetRongheSelectPnl(null, petPnl.m_uuPetID0, 999);
                    petPnl.ShowHideModel(false);
                }
            }
        }
        else if (gameObject.name == "btnRonghe")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetRonghePnl petPnl = wnd.GetComponentInChildren <sdUIPetRonghePnl>();
                if (petPnl)
                {
                    if (petPnl.m_uuPetID0 != UInt64.MaxValue && petPnl.m_uuPetID1 != UInt64.MaxValue)
                    {
                        sdPetMsg.Send_CS_PET_MERGE_REQ(petPnl.m_uuPetID0, petPnl.m_uuPetID1);
                        petPnl.OnClickRongheBtn();
                    }
                    else
                    {
                        sdUICharacter.Instance.ShowOkMsg("请选择两个战魂作为融合材料", null);
                    }
                    //petPnl.OnClickRongheBtn();
                    //petPnl.m_bBeginRonghe = true;
                    //petPnl.m_iPetIDNew = 102;
                    //petPnl.LoadRongheEffect();
                }
            }
        }
        else if (gameObject.name == "btnRongheShow")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetRonghePnl petPnl = wnd.GetComponentInChildren <sdUIPetRonghePnl>();
                if (petPnl)
                {
                    if (petPnl.m_iPetIDNew > 0)
                    {
                        sdUIPetControl.Instance.ActivePetSmallTip(null, petPnl.m_iPetIDNew, 0, 1);
                        petPnl.ShowHideModel(false);
                    }
                }
            }
        }
        else if (gameObject.name == "btnRongheBack")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetRonghePnl petPnl = wnd.GetComponentInChildren <sdUIPetRonghePnl>();
                if (petPnl)
                {
                    petPnl.ResetPetRongheUI();
                    petPnl.ShowRonghePetSelectLeftModel();
                    petPnl.ShowRonghePetSelectRightModel();
                }
            }
        }
        //宠物融合选择界面..
        else if (gameObject.name == "rongheSelectClose")
        {
            if (sdUIPetControl.m_UIPetRongheSelectPnl != null)
            {
                WndAni.HideWndAni(sdUIPetControl.m_UIPetRongheSelectPnl, false, "bg_grey");
                if (!sdUIPetControl.Instance.IsReturnLevelPrepare())
                {
                    sdUIPetRongheSelectPnl obj = sdUIPetControl.m_UIPetRongheSelectPnl.GetComponent <sdUIPetRongheSelectPnl>();
                    if (obj != null && obj.m_preWnd != null)
                    {
                        obj.m_preWnd.SetActive(true);
                    }
                }

                GameObject wnd = sdGameLevel.instance.NGUIRoot;
                if (wnd)
                {
                    sdUIPetRonghePnl petPnl = wnd.GetComponentInChildren <sdUIPetRonghePnl>();
                    if (petPnl)
                    {
                        petPnl.ShowHideModel(true);
                    }
                }
            }
        }
        //宠物图鉴界面..
        else if (gameObject.name == "petTujianClose")
        {
            if (sdUIPetControl.m_UIPetTujianPnl != null)
            {
                WndAni.HideWndAni(sdUIPetControl.m_UIPetTujianPnl, true, "w_black");
                if (sdUIPetControl.m_UIPetListPnl)
                {
                    WndAni.HideWndAni(sdUIPetControl.m_UIPetListPnl, true, "w_black");
                }
                if (!sdUIPetControl.Instance.IsReturnLevelPrepare())
                {
                    sdUIPetTujianPnl obj = sdUIPetControl.m_UIPetTujianPnl.GetComponent <sdUIPetTujianPnl>();
                    if (obj != null && obj.m_preWnd != null)
                    {
                        obj.m_preWnd.SetActive(true);
                    }
                }
            }

            if (sdUICharacter.Instance.GetTownUI() != null)
            {
                sdUICharacter.Instance.GetTownUI().GetComponent <sdTown>().lockPanel.SetActive(false);
            }
        }
        //宠物战队界面..
        else if (gameObject.name == "petWarClose")
        {
            if (sdUIPetControl.m_UIPetWarPnl != null)
            {
                if (!sdUIPetControl.Instance.IsReturnLevelPrepare())
                {
                    sdUIPetWarPnl obj = sdUIPetControl.m_UIPetWarPnl.GetComponent <sdUIPetWarPnl>();
                    if (obj != null && obj.m_preWnd != null)
                    {
                        obj.m_preWnd.SetActive(true);
                    }
                }
                WndAni.HideWndAni(sdUIPetControl.m_UIPetWarPnl, true, "w_black");
            }

            if (sdUICharacter.Instance.GetTownUI() != null)
            {
                sdUICharacter.Instance.GetTownUI().GetComponent <sdTown>().lockPanel.SetActive(false);
            }
        }
        else if (gameObject.name == "rbPetWar1")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetWarPnl petWarPnl = wnd.GetComponentInChildren <sdUIPetWarPnl>();
                if (petWarPnl)
                {
                    petWarPnl.mCurTeamIndex = 0;
                    petWarPnl.ReflashPetBattleTeam();
                    petWarPnl.RefreshPetZuhePage();
                }
            }
        }
        else if (gameObject.name == "rbPetWar2")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetWarPnl petWarPnl = wnd.GetComponentInChildren <sdUIPetWarPnl>();
                if (petWarPnl)
                {
                    petWarPnl.mCurTeamIndex = 1;
                    petWarPnl.ReflashPetBattleTeam();
                    petWarPnl.RefreshPetZuhePage();
                }
            }
        }
        else if (gameObject.name == "rbPetWar3")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetWarPnl petWarPnl = wnd.GetComponentInChildren <sdUIPetWarPnl>();
                if (petWarPnl)
                {
                    petWarPnl.mCurTeamIndex = 2;
                    petWarPnl.ReflashPetBattleTeam();
                    petWarPnl.RefreshPetZuhePage();
                }
            }
        }
        else if (gameObject.name == "btnAccept")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetWarPnl petWarPnl = wnd.GetComponentInChildren <sdUIPetWarPnl>();
                if (petWarPnl)
                {
                    if (petWarPnl.mCurTeamIndex != sdNewPetMgr.Instance.mPetCurTeam)
                    {
                        sdPetMsg.Send_CS_PET_TEAM_RPT(petWarPnl.mCurTeamIndex);
                    }
                }
            }
        }
        //战队选择面板..
        else if (gameObject.name == "warSelectClose")
        {
            if (sdUIPetControl.m_UIPetWarSelectPnl != null)
            {
                WndAni.HideWndAni(sdUIPetControl.m_UIPetWarSelectPnl, false, "bg_grey");
                if (!sdUIPetControl.Instance.IsReturnLevelPrepare())
                {
                    sdUIPetWarSelectPnl obj = sdUIPetControl.m_UIPetWarSelectPnl.GetComponent <sdUIPetWarSelectPnl>();
                    if (obj != null && obj.m_preWnd != null)
                    {
                        obj.m_preWnd.SetActive(true);
                    }
                }
            }
        }
        //宠物属性界面..
        else if (gameObject.name == "petPropClose")
        {
            if (sdUIPetControl.m_UIPetPropPnl != null)
            {
                WndAni.HideWndAni(sdUIPetControl.m_UIPetPropPnl, false, "bg_grey");
                if (!sdUIPetControl.Instance.IsReturnLevelPrepare())
                {
                    sdUIPetPropPnl obj = sdUIPetControl.m_UIPetPropPnl.GetComponent <sdUIPetPropPnl>();
                    if (obj != null && obj.m_preWnd != null)
                    {
                        obj.m_preWnd.SetActive(true);
                    }
                }
            }
        }
        else if (gameObject.name == "btnPetlock")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetPropPnl petPnl = wnd.GetComponentInChildren <sdUIPetPropPnl>();
                if (petPnl)
                {
                    SClientPetInfo Info = sdNewPetMgr.Instance.GetPetInfo(petPnl.m_uuDBID);
                    if (Info == null)
                    {
                        return;
                    }

                    sdPetMsg.Send_CS_LOCK_RPT((int)HeaderProto.ELockType.PET_LOCK, petPnl.m_uuDBID, 1 - Info.m_Lock);

                    if (Info.m_Lock == 1)
                    {
                        sdUICharacter.Instance.ShowMsgLine("解锁成功", Color.yellow);
                    }
                    else
                    {
                        sdUICharacter.Instance.ShowMsgLine("加锁成功", Color.yellow);
                    }
                }
            }
        }
        else if (gameObject.name == "btnPetshow")
        {
        }
        else if (gameObject.name == "propModelLeft")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetPropPnl petPnl = wnd.GetComponentInChildren <sdUIPetPropPnl>();
                if (petPnl)
                {
                    sdConfDataMgr.Instance().OnModelClickRandomPlayAnm(petPnl.GetPetModel());
                }
            }
        }
        else if (gameObject.name == "RbPropDesc")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetPropPnl petPnl = wnd.GetComponentInChildren <sdUIPetPropPnl>();
                if (petPnl)
                {
                    petPnl.PropUIShow(0);
                }
            }
        }
        else if (gameObject.name == "RbPropJn")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetPropPnl petPnl = wnd.GetComponentInChildren <sdUIPetPropPnl>();
                if (petPnl)
                {
                    petPnl.PropUIShow(2);
                }
            }
        }
        else if (gameObject.name == "RbPropZh")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetPropPnl petPnl = wnd.GetComponentInChildren <sdUIPetPropPnl>();
                if (petPnl)
                {
                    petPnl.PropUIShow(3);
                }
            }
        }
        else if (gameObject.name == "btnPetLevelup")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetPropPnl petPnl = wnd.GetComponentInChildren <sdUIPetPropPnl>();
                if (petPnl)
                {
                    SClientPetInfo Info = null;
                    if (petPnl.m_uuDBID == UInt64.MaxValue)
                    {
                        return;
                    }
                    Info = sdNewPetMgr.Instance.GetPetInfo(petPnl.m_uuDBID);
                    if (Info == null)
                    {
                        return;
                    }

                    if (Info.m_CanLevelUp != 1)
                    {
                        sdUICharacter.Instance.ShowOkMsg("该战魂不能升级", null);
                        return;
                    }

                    int iLevel   = Info.m_iLevel;
                    int iMyLevel = int.Parse(sdGameLevel.instance.mainChar.Property["Level"].ToString());
                    iMyLevel = iMyLevel + 20;
                    if (iLevel >= sdNewPetMgr.MAX_PET_LEVEL)
                    {
                        sdUICharacter.Instance.ShowOkMsg("该战魂已经满级", null);
                    }
                    else if (iLevel < sdNewPetMgr.MAX_PET_LEVEL && iLevel >= iMyLevel)
                    {
                        sdUICharacter.Instance.ShowOkMsg("战魂等级不可高于主角等级20级以上", null);
                    }
                    else
                    {
                        sdNewPetMgr.Instance.ResetPetLevelUpDBID();
                        if (sdUIPetControl.m_UIPetPropPnl != null)
                        {
                            UInt64 uuDBID = petPnl.m_uuDBID;
                            //隐藏属性界面模型..
                            petPnl.SetPetModelVisible(false);
                            //这里弹出升级界面..
                            sdUIPetControl.Instance.ActivePetLevelPnl(null, uuDBID);
                        }
                    }
                }
            }
        }
        else if (gameObject.name == "btnPetStrong")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetPropPnl petPnl = wnd.GetComponentInChildren <sdUIPetPropPnl>();
                if (petPnl)
                {
                    SClientPetInfo Info = null;
                    if (petPnl.m_uuDBID == UInt64.MaxValue)
                    {
                        return;
                    }
                    Info = sdNewPetMgr.Instance.GetPetInfo(petPnl.m_uuDBID);
                    if (Info == null)
                    {
                        return;
                    }

                    int iLevel = Info.m_iLevel;
                    int iUp    = Info.m_iUp;
                    if (iUp >= sdNewPetMgr.MAX_PET_STRONG_LEVEL)
                    {
                        sdUICharacter.Instance.ShowOkMsg("该战魂已经强化到最高级别", null);
                    }
                    else
                    {
                        if (iLevel < sdNewPetMgr.MAX_PET_CAN_STRONG_LEVEL)
                        {
                            sdUICharacter.Instance.ShowOkMsg("战魂等级达到20级后可开启战魂强化", null);
                        }
                        else
                        {
                            sdNewPetMgr.Instance.m_uuPetStrongSelectID = UInt64.MaxValue;

                            if (sdUIPetControl.m_UIPetPropPnl != null)
                            {
                                UInt64 uuDBID = petPnl.m_uuDBID;
                                //关闭属性界面..
                                petPnl.SetPetModelVisible(false);
                                //这里弹出强化界面..
                                sdUIPetControl.Instance.ActivePetStrongPnl(null, uuDBID);
                            }
                        }
                    }
                }
            }
        }
        else if (gameObject.name == "btnPetGather")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetPropPnl petPnl = wnd.GetComponentInChildren <sdUIPetPropPnl>();
                if (petPnl)
                {
                    int iPetId = petPnl.m_iPetTemplateID;
                    if (iPetId > 0)
                    {
                        int iCurNum = sdNewPetMgr.Instance.getPetGatherCurNumByPetId(iPetId);
                        int iMaxNum = sdNewPetMgr.Instance.getPetGatherMaxNumByPetId(iPetId);
                        if (iCurNum >= iMaxNum && iMaxNum > 0)
                        {
                            Hashtable info = sdConfDataMgr.Instance().GetPetTemplate(iPetId.ToString());
                            if (info != null)
                            {
                                sdMsgBox.OnConfirm btn_ok = new sdMsgBox.OnConfirm(OnClickPetGatherOk);
                                sdUICharacter.Instance.ShowOkCanelMsg("确定要将已有碎片合成么?", btn_ok, null);
                            }
                            else
                            {
                                sdUICharacter.Instance.ShowOkMsg("无效的宠物ID", null);
                            }
                        }
                        else
                        {
                            sdUICharacter.Instance.ShowOkMsg("没有足够的碎片", null);
                        }
                    }
                }
            }
        }
        //升级界面..
        else if (gameObject.name == "petLevelClose")
        {
            if (sdUIPetControl.m_UIPetLevelPnl != null)
            {
                UInt64          uuDBID = UInt64.MaxValue;
                sdUIPetLevelPnl obj    = sdUIPetControl.m_UIPetLevelPnl.GetComponent <sdUIPetLevelPnl>();
                if (obj != null)
                {
                    uuDBID = obj.m_uuDBID;
                }

                sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetLevelPnl);
                //WndAni.HideWndAni(sdUIPetControl.m_UIPetLevelPnl,false,"bg_grey");
                if (!sdUIPetControl.Instance.IsReturnLevelPrepare())
                {
                    if (obj != null && obj.m_preWnd != null)
                    {
                        obj.m_preWnd.SetActive(true);
                    }
                }

                GameObject wnd = sdGameLevel.instance.NGUIRoot;
                if (wnd)
                {
                    sdUIPetPropPnl petPnl = wnd.GetComponentInChildren <sdUIPetPropPnl>();
                    if (petPnl)
                    {
                        petPnl.SetPetModelVisible(true);
                    }
                }
            }
        }
        else if (gameObject.name == "levelModelLeft")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetLevelPnl petPnl = wnd.GetComponentInChildren <sdUIPetLevelPnl>();
                if (petPnl)
                {
                    sdConfDataMgr.Instance().OnModelClickRandomPlayAnm(petPnl.GetPetModel());
                }
            }
        }
        else if (gameObject.name == "btnPetLevelupOk")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetLevelPnl petPnl = wnd.GetComponentInChildren <sdUIPetLevelPnl>();
                if (petPnl)
                {
                    if (petPnl.m_iLevelUpingSetp != 0 || sdPetMsg.bPetLeveling == true)
                    {
                        return;
                    }

                    if (sdNewPetMgr.Instance.AllPetLevelUpDBIDIsNull() == true)
                    {
                        sdUICharacter.Instance.ShowOkMsg("请选择战魂升级材料", null);
                    }
                    else
                    {
                        uint        uiCost    = (uint)petPnl.GetPetLevelUpCost();
                        uint        uiMyMoney = 0;
                        sdGameLevel level     = sdGameLevel.instance;
                        if (level != null)
                        {
                            if (level.mainChar != null)
                            {
                                Hashtable prop = level.mainChar.GetProperty();
                                uiMyMoney = (uint)prop["NonMoney"];
                            }
                        }

                        if (uiCost > uiMyMoney)
                        {
                            sdUICharacter.Instance.ShowOkMsg("没有足够的金币", null);
                        }
                        else
                        {
                            petPnl.SendPetLevelUpMsg();
                        }
                    }
                }
            }
        }
        else if (gameObject.name == "btnPetLevelAutoSelect")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetLevelPnl petPnl = wnd.GetComponentInChildren <sdUIPetLevelPnl>();
                if (petPnl)
                {
                    if (petPnl.m_iLevelUpingSetp != 0 || sdPetMsg.bPetLeveling == true)
                    {
                        return;
                    }
                }

                if (petPnl)
                {
                    SClientPetInfo Info = null;
                    if (petPnl.m_uuDBID == UInt64.MaxValue)
                    {
                        return;
                    }
                    Info = sdNewPetMgr.Instance.GetPetInfo(petPnl.m_uuDBID);
                    if (Info == null)
                    {
                        return;
                    }

                    int iLevel   = Info.m_iLevel;
                    int iMyLevel = int.Parse(sdGameLevel.instance.mainChar.Property["Level"].ToString());
                    iMyLevel = iMyLevel + 20;
                    if (iLevel >= sdNewPetMgr.MAX_PET_LEVEL)
                    {
                        sdUICharacter.Instance.ShowOkMsg("该战魂已经满级", null);
                        return;
                    }
                    else if (iLevel < sdNewPetMgr.MAX_PET_LEVEL && iLevel >= iMyLevel)
                    {
                        sdUICharacter.Instance.ShowOkMsg("战魂等级不可高于主角等级20级以上", null);
                        return;
                    }
                }
            }

            sdNewPetMgr.Instance.AutoSelectPetLevelMaterial();
        }
        else if (gameObject.name == "panEnd")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetLevelPnl petPnl = wnd.GetComponentInChildren <sdUIPetLevelPnl>();
                if (petPnl && petPnl.m_iLevelUpingSetp == 5 && petPnl.m_bBeginLineMove == true)
                {
                    petPnl.m_iLevelUpingSetp = 6;
                }
            }
        }
        //升级材料选择..
        else if (gameObject.name == "levelupSelectClose")
        {
            if (sdUIPetControl.m_UIPetLevelSelectPnl != null)
            {
                sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetLevelSelectPnl);
                //WndAni.HideWndAni(sdUIPetControl.m_UIPetLevelSelectPnl,false,"bg_grey");
                if (!sdUIPetControl.Instance.IsReturnLevelPrepare())
                {
                    sdUIPetLevelSelectPnl obj = sdUIPetControl.m_UIPetLevelSelectPnl.GetComponent <sdUIPetLevelSelectPnl>();
                    if (obj != null && obj.m_preWnd != null)
                    {
                        obj.m_preWnd.SetActive(true);
                    }
                }

                GameObject wnd = sdGameLevel.instance.NGUIRoot;
                if (wnd)
                {
                    sdUIPetLevelPnl petPnl = wnd.GetComponentInChildren <sdUIPetLevelPnl>();
                    if (petPnl)
                    {
                        petPnl.SetPetModelVisible(true);
                    }
                }
            }
        }
        else if (gameObject.name == "btnLevelSelectGo")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetLevelSelectPnl petPnl = wnd.GetComponentInChildren <sdUIPetLevelSelectPnl>();
                if (petPnl)
                {
                    sdNewPetMgr.Instance.m_uuPetLevelSelectID[0] = petPnl.m_uuSelectDBID0;
                    sdNewPetMgr.Instance.m_uuPetLevelSelectID[1] = petPnl.m_uuSelectDBID1;
                    sdNewPetMgr.Instance.m_uuPetLevelSelectID[2] = petPnl.m_uuSelectDBID2;
                    sdNewPetMgr.Instance.m_uuPetLevelSelectID[3] = petPnl.m_uuSelectDBID3;
                    sdNewPetMgr.Instance.m_uuPetLevelSelectID[4] = petPnl.m_uuSelectDBID4;
                    sdNewPetMgr.Instance.m_uuPetLevelSelectID[5] = petPnl.m_uuSelectDBID5;
                    sdNewPetMgr.Instance.m_uuPetLevelSelectID[6] = petPnl.m_uuSelectDBID6;
                    sdNewPetMgr.Instance.m_uuPetLevelSelectID[7] = petPnl.m_uuSelectDBID7;

                    if (sdUIPetControl.m_UIPetLevelSelectPnl != null)
                    {
                        sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetLevelSelectPnl);
                    }

                    sdUIPetLevelPnl petLevelPnl = wnd.GetComponentInChildren <sdUIPetLevelPnl>();
                    if (petLevelPnl)
                    {
                        petLevelPnl.ReflashPetLevelIcon(true);
                        petLevelPnl.ResetPetLevelCostAndExp();
                        petLevelPnl.SetPetModelVisible(true);
                    }
                }
            }
        }
        //强化界面..
        else if (gameObject.name == "petStrongClose")
        {
            if (sdUIPetControl.m_UIPetStrongPnl != null)
            {
                UInt64           uuDBID = UInt64.MaxValue;
                sdUIPetStrongPnl obj    = sdUIPetControl.m_UIPetStrongPnl.GetComponent <sdUIPetStrongPnl>();
                if (obj != null)
                {
                    uuDBID = obj.m_uuDBID;
                }

                sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetStrongPnl);
                //WndAni.HideWndAni(sdUIPetControl.m_UIPetStrongPnl,false,"bg_grey");
                if (!sdUIPetControl.Instance.IsReturnLevelPrepare())
                {
                    if (obj != null && obj.m_preWnd != null)
                    {
                        obj.m_preWnd.SetActive(true);
                    }
                }

                GameObject wnd = sdGameLevel.instance.NGUIRoot;
                if (wnd)
                {
                    sdUIPetPropPnl petPnl = wnd.GetComponentInChildren <sdUIPetPropPnl>();
                    if (petPnl)
                    {
                        petPnl.SetPetModelVisible(true);
                    }
                }
            }
        }
        else if (gameObject.name == "btnPetStrongOk")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetStrongPnl petPnl = wnd.GetComponentInChildren <sdUIPetStrongPnl>();
                if (petPnl)
                {
                    petPnl.OnClickStrongOk();
                }
            }
        }
        //强化选择界面..
        else if (gameObject.name == "strongSelectClose")
        {
            if (sdUIPetControl.m_UIPetStrongSelectPnl != null)
            {
                sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetStrongSelectPnl);
                //WndAni.HideWndAni(sdUIPetControl.m_UIPetStrongSelectPnl,false,"bg_grey");
                if (!sdUIPetControl.Instance.IsReturnLevelPrepare())
                {
                    sdUIPetStrongSelectPnl obj = sdUIPetControl.m_UIPetStrongSelectPnl.GetComponent <sdUIPetStrongSelectPnl>();
                    if (obj != null && obj.m_preWnd != null)
                    {
                        obj.m_preWnd.SetActive(true);
                    }
                }
            }
        }
    }
示例#8
0
    void OnClick()
    {
        if (panel == PanelType.Panel_ItemUp)
        {
            if (index == 0)
            {
                sdUICharacter.Instance.ShowItemSelectWnd(SelectType.ItemUpChange);
                sdUICharacter.Instance.AddEventOnSelectWnd(new EventDelegate(sdUICharacter.Instance.OnChangeUpItem));
                return;
            }
            else if (index == -1)
            {
                return;
            }

            if (sdGameItemMgr.Instance.upItem == null)
            {
                sdUICharacter.Instance.ShowMsgLine(sdConfDataMgr.Instance().GetShowStr("SelectUpItem"), Color.yellow);
                return;
            }

            sdUICharacter.Instance.ShowItemSelectWnd(SelectType.ItemUp);
            sdUICharacter.Instance.AddEventOnSelectWnd(new EventDelegate(sdUICharacter.Instance.GetItemUpWnd().OnSelectItemOk));
            return;
        }
        else if (panel == PanelType.Panel_ItemMake)
        {
            if (index == 0)
            {
                sdUICharacter.Instance.ShowItemSelectWnd(SelectType.ItemMake);
                sdUICharacter.Instance.AddEventOnSelectWnd(new EventDelegate(sdUICharacter.Instance.GetItemUpWnd().SelectItemMake));
                return;
            }
            else
            {
                sdUICharacter.Instance.ShowTip(TipType.TempItem, tempId);
                return;
            }
        }
        else if (panel == PanelType.Panel_GemReplace)
        {
            if (itemid != "0" && itemid != "")
            {
                if (sdGameItemMgr.Instance.selGemList.ContainsKey(itemid))
                {
                    int num = sdGameItemMgr.Instance.selGemList[itemid];
                    if (num == 1)
                    {
                        sdGameItemMgr.Instance.selGemList.Remove(itemid);
                    }
                    else
                    {
                        sdGameItemMgr.Instance.selGemList[itemid]--;
                    }
                }
                SetInfo("0", null);
                return;
            }

            sdUICharacter.Instance.ShowItemSelectWnd(SelectType.GemReplace);
            //sdUICharacter.Instance.AddEventOnSelectWnd(new EventDelegate(sdUICharacter.Instance.GetItemUpWnd().OnSelectGemReplace));
            sdUICharacter.Instance.AddEventOnSelectWnd(new EventDelegate(OnSelectGemReplace));
            return;
        }
        else if (panel == PanelType.Panel_GemMerge)
        {
            if (index > 2)
            {
                return;
            }
            if (itemid != "0" && itemid != "")
            {
                if (sdGameItemMgr.Instance.selGemList.ContainsKey(itemid))
                {
                    int num = sdGameItemMgr.Instance.selGemList[itemid];
                    if (num == 1)
                    {
                        sdGameItemMgr.Instance.selGemList.Remove(itemid);
                    }
                    else
                    {
                        sdGameItemMgr.Instance.selGemList[itemid]--;
                    }
                }
                SetInfo("0", null);
                return;
            }
            sdUICharacter.Instance.ShowItemSelectWnd(SelectType.GemMerge);
            sdUICharacter.Instance.AddEventOnSelectWnd(new EventDelegate(SelectGemMerge));
            return;
        }
        else if (panel == PanelType.Panel_GemSet)
        {
            if (index > 2)
            {
                return;
            }
            if (sdGameItemMgr.Instance.upItem == null)
            {
                sdUICharacter.Instance.ShowMsgLine(sdConfDataMgr.Instance().GetShowStr("SelectGemItem"), Color.yellow);
                return;
            }
            if (itemid == "-1")
            {
                sdUICharacter.Instance.ShowMsgLine(sdConfDataMgr.Instance().GetShowStr("GemOnError1"), Color.yellow);
                return;
            }
            if (itemid != "0" && itemid != "")
            {
                //sdGameItem item = sdGameItemMgr.Instance.getItem(ulong.Parse(itemid));
                Hashtable          info      = sdConfDataMgr.Instance().GetItemById(tempId);
                Hashtable          gemInfo   = sdConfDataMgr.Instance().GetGemLevel(info["Level"].ToString());
                string             needMoney = gemInfo["HoleOffMoney"].ToString();
                sdMsgBox.OnConfirm ok        = new sdMsgBox.OnConfirm(OnGemOff);
                sdUICharacter.Instance.ShowOkCanelMsg(string.Format(sdConfDataMgr.Instance().GetShowStr("GemOffConfirm"), needMoney), ok, null);
                return;
            }
            sdUICharacter.Instance.ShowItemSelectWnd(SelectType.GemOn);
            sdUICharacter.Instance.AddEventOnSelectWnd(new EventDelegate(sdUICharacter.Instance.GetItemUpWnd().SelectGemSet));
            sdGameItemMgr.Instance.gemIndex = index;
            return;
        }
        else if (panel == PanelType.Panel_PvpReward || panel == PanelType.Panel_PVPRankReward)
        {
            if (itemid == "100" || itemid == "101" || itemid == "200" || itemid.Length == 0)
            {
                return;
            }
            Hashtable info = sdConfDataMgr.Instance().GetItemById(itemid);
            if (info != null && info.ContainsKey("Class") && int.Parse(info["Class"].ToString()) == (int)HeaderProto.EItemClass.ItemClass_Pet_Item)
            {
                sdUIPetControl.Instance.ActivePetSmallTip(null, int.Parse(itemInfo["Expend"].ToString()), 0, 1);
                return;
            }
            else
            {
                sdUICharacter.Instance.ShowTip(TipType.TempItem, tempId);
                return;
            }
        }

        if (itemid == "")
        {
            if (panel == PanelType.Panel_Equip)
            {
                if (sdGameItemMgr.Instance.GetBagItemByEquipPos(index, true).Count == 0)
                {
                    sdUICharacter.Instance.ShowMsgLine(sdConfDataMgr.Instance().GetShowStr("NoEquip"), Color.yellow);
                    return;
                }
                //sdUICharacter.Instance.ShowBag();
                sdUICharacter.Instance.SetSelectWndNeedPos(index);
                sdUICharacter.Instance.ShowItemSelectWnd(SelectType.EquipSelect);
                sdUICharacter.Instance.AddEventOnSelectWnd(new EventDelegate(sdUICharacter.Instance.OnChangeEquip));
                //sdSlotMgr.Instance.GotoEquip(index);
            }
            return;
        }

        if (!enable)
        {
            return;
        }

        if (panel == PanelType.Panel_Skill_Active || panel == PanelType.Panel_Skill_Passive)
        {
            Hashtable   item  = sdConfDataMgr.Instance().GetSkill(itemid);
            sdGameSkill skill = sdGameSkillMgr.Instance.GetSkill(int.Parse(itemid));
            TipType     type  = (panel == PanelType.Panel_Skill_Active)?TipType.Skill:TipType.PassiveSkill;
            sdUICharacter.Instance.ShowTip(type, itemid);
            return;
        }

        if (panel == PanelType.Panel_Treasure)
        {
            return;

            sdUICharacter.Instance.ShowTip(TipType.TempItem, itemid);
            return;
        }

        if (panel == PanelType.Panel_Jiesuan)
        {
            if (jiesuanType == JiesuanSlotType.Pet)
            {
                Hashtable info = sdConfDataMgr.Instance().GetItemById(itemid);
                if (info == null)
                {
                    info = itemInfo;
                }
                if (info != null)
                {
                    sdUIPetControl.Instance.ActivePetSmallTip(null, int.Parse(itemInfo["Expend"].ToString()), 0, 1);
                }

                return;
            }
            else if (jiesuanType == JiesuanSlotType.PetItem)
            {
                sdGamePetItem petItem = sdNewPetMgr.Instance.getPetItem(ulong.Parse(itemid));
                if (petItem != null)
                {
                    sdUIPetControl.Instance.ActivePetEquipTip(null, petItem.templateID);
                }

                return;
            }
        }

        if (panel == PanelType.Panel_ItemSelect)
        {
            if (!isSelected)
            {
                if (sdUICharacter.Instance.AddSelectItem(itemid))
                {
                    isSelected = true;
                    if (gameObject.transform.FindChild("bgselect") != null)
                    {
                        gameObject.transform.FindChild("bgselect").GetComponent <UISprite>().spriteName = "g";
                    }
                }
            }
            else
            {
                isSelected = false;
                if (gameObject.transform.FindChild("bgselect") != null)
                {
                    gameObject.transform.FindChild("bgselect").GetComponent <UISprite>().spriteName = "";
                }

                sdUICharacter.Instance.RemoveSelectItem(itemid);
            }
            return;
        }

        if (panel == PanelType.Panel_Bag)
        {
            sdGameItem item = sdGameItemMgr.Instance.getItem(ulong.Parse(itemid));
            if (item != null)
            {
                item.isNew = false;
            }
            SetNew(false);
            sdRoleWnd wnd = sdUICharacter.Instance.GetRoleWnd().GetComponent <sdRoleWnd>();
            if (wnd != null)
            {
                if (wnd.otherBtn.isActive)
                {
                    bool      hasNew    = false;
                    Hashtable itemTable = sdGameItemMgr.Instance.GetAllItem((int)PanelType.Panel_Bag, (int)ItemFilter.Other);
                    foreach (DictionaryEntry info in itemTable)
                    {
                        sdGameItem temp = info.Value as sdGameItem;
                        if (temp.isNew)
                        {
                            hasNew = true;
                            break;
                        }
                    }

                    if (!hasNew)
                    {
                        wnd.otherBtn.HideRedTip();
                    }
                }

                if (wnd.armorBtn.isActive)
                {
                    bool      hasNew    = false;
                    Hashtable itemTable = sdGameItemMgr.Instance.GetAllItem((int)PanelType.Panel_Bag, (int)ItemFilter.Armor);
                    foreach (DictionaryEntry info in itemTable)
                    {
                        sdGameItem temp = info.Value as sdGameItem;
                        if (temp.isNew)
                        {
                            hasNew = true;
                            break;
                        }
                    }

                    if (!hasNew)
                    {
                        wnd.armorBtn.HideRedTip();
                    }
                }

                if (wnd.weaponBtn.isActive)
                {
                    bool      hasNew    = false;
                    Hashtable itemTable = sdGameItemMgr.Instance.GetAllItem((int)PanelType.Panel_Bag, (int)ItemFilter.Weapon);
                    foreach (DictionaryEntry info in itemTable)
                    {
                        sdGameItem temp = info.Value as sdGameItem;
                        if (temp.isNew)
                        {
                            hasNew = true;
                            break;
                        }
                    }

                    if (!hasNew)
                    {
                        wnd.weaponBtn.HideRedTip();
                    }
                }

                if (wnd.shipinBtn.isActive)
                {
                    bool      hasNew    = false;
                    Hashtable itemTable = sdGameItemMgr.Instance.GetAllItem((int)PanelType.Panel_Bag, (int)ItemFilter.Shipin);
                    foreach (DictionaryEntry info in itemTable)
                    {
                        sdGameItem temp = info.Value as sdGameItem;
                        if (temp.isNew)
                        {
                            hasNew = true;
                            break;
                        }
                    }

                    if (!hasNew)
                    {
                        wnd.shipinBtn.HideRedTip();
                    }
                }
            }
        }

        sdUICharacter.Instance.ShowTip(TipType.Item, itemid);
    }
示例#9
0
    void OnClick()
    {
        if (gameObject.name == "wndClose")
        {
            if (sdMailControl.m_UIMailWnd != null)
            {
                WndAni.HideWndAni(sdMailControl.m_UIMailWnd, true, "w_black");
            }
            //sdMailControl.Instance.CloseGameWnd(sdMailControl.m_UIMailWnd);
        }
        else if (gameObject.name == "detailClose")
        {
            if (sdMailControl.m_UIMailDetailWnd != null)
            {
                WndAni.HideWndAni(sdMailControl.m_UIMailDetailWnd, false, "bg_grey");
            }
            //sdMailControl.Instance.CloseGameWnd(sdMailControl.m_UIMailDetailWnd);
        }
        else if (gameObject.name == "btnGetItem")
        {
            UInt64 mailID = gameObject.transform.parent.transform.parent.transform.parent.transform.GetComponent <sdUIMailIcon>().GetId();
            HeaderProto.SMailDetail detail = sdMailMgr.Instance.GetMailInfo(mailID);
            if (detail != null)
            {
                if (detail.m_ItemCount > 0)
                {
                    sdMailMsg.Send_CS_GET_ITEM_FROM_MAIL_REQ(mailID);
                }

                if (detail.m_Money > 0)
                {
                    sdMailMsg.Send_CS_GET_MONEY_FROM_MAIL_REQ(mailID);
                }

                if (detail.m_ReadTime == 0)
                {
                    sdMailMsg.Send_CS_READ_MAIL_REQ(mailID);
                }
            }
        }
        else if (gameObject.name == "btnDelOld")
        {
            Hashtable list = null;
            list = sdMailMgr.Instance.m_MailList;
            ushort index = 0;
            HeaderProto.MAIL_ID_LIST mailIDList = new HeaderProto.MAIL_ID_LIST();
            foreach (DictionaryEntry info in list)
            {
                UInt64 key1 = UInt64.Parse(info.Key.ToString());
                HeaderProto.SMailDetail detail = info.Value as HeaderProto.SMailDetail;
                if (detail.m_ItemCount == 0 && detail.m_ReadTime > 0)
                {
                    mailIDList.m_MailIDs[index] = key1;
                    index++;
                }
            }
            mailIDList.m_Count = index;

            if (index > 0)
            {
                sdMailMsg.Send_CS_DELETE_MAIL_REQ(mailIDList);
            }
        }
        else if (gameObject.name == "btnSendMail")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIMailWnd mailWnd = wnd.GetComponentInChildren <sdUIMailWnd>();
                if (mailWnd)
                {
                    mailWnd.OnSendMail();
                }
            }
        }
        else if (gameObject.name == "TabMailList")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIMailWnd mailWnd = wnd.GetComponentInChildren <sdUIMailWnd>();
                if (mailWnd)
                {
                    mailWnd.ShowMailWndPanel(1);
                    mailWnd.RefreshMailList();
                }
            }
        }
        else if (gameObject.name == "TabSendList")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIMailWnd mailWnd = wnd.GetComponentInChildren <sdUIMailWnd>();
                if (mailWnd)
                {
                    mailWnd.ShowMailWndPanel(2);
                }
            }
        }
        else if (gameObject.name == "btnGetDetailItem")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIMailDetailWnd mailDetailWnd = wnd.GetComponentInChildren <sdUIMailDetailWnd>();
                if (mailDetailWnd)
                {
                    HeaderProto.SMailDetail detail = sdMailMgr.Instance.GetMailInfo(mailDetailWnd.m_uuMailID);
                    if (detail != null)
                    {
                        if (detail.m_ItemCount > 0)
                        {
                            sdMailMsg.Send_CS_GET_ITEM_FROM_MAIL_REQ(mailDetailWnd.m_uuMailID);
                        }

                        if (detail.m_Money > 0)
                        {
                            sdMailMsg.Send_CS_GET_MONEY_FROM_MAIL_REQ(mailDetailWnd.m_uuMailID);
                        }

                        if (detail.m_ReadTime == 0)
                        {
                            sdMailMsg.Send_CS_READ_MAIL_REQ(mailDetailWnd.m_uuMailID);
                        }
                    }
                }
            }
        }
        else if (gameObject.name == "btnDelDetailMail")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIMailDetailWnd mailDetailWnd = wnd.GetComponentInChildren <sdUIMailDetailWnd>();
                if (mailDetailWnd)
                {
                    HeaderProto.SMailDetail detail = sdMailMgr.Instance.GetMailInfo(mailDetailWnd.m_uuMailID);
                    if (detail != null && detail.m_ItemCount <= 0 && detail.m_Money <= 0)
                    {
                        HeaderProto.MAIL_ID_LIST mailIDList = new HeaderProto.MAIL_ID_LIST();
                        mailIDList.m_Count      = 1;
                        mailIDList.m_MailIDs[0] = mailDetailWnd.m_uuMailID;
                        sdMailMsg.Send_CS_DELETE_MAIL_REQ(mailIDList);

                        if (sdMailControl.m_UIMailDetailWnd != null)
                        {
                            sdMailControl.Instance.CloseGameWnd(sdMailControl.m_UIMailDetailWnd);
                        }

                        return;
                    }

                    if (detail != null && (detail.m_ItemCount > 0 || detail.m_Money > 0))
                    {
                        sdMsgBox.OnConfirm btn_Delete = new sdMsgBox.OnConfirm(OnClickDel);
                        sdUICharacter.Instance.ShowOkCanelMsg("该邮件存在物品或金钱,确定要删除么?", btn_Delete, null);
                        return;
                    }
                }
            }
        }
        else if (gameObject.name == "mailBtn")
        {
            sdMailControl.Instance.ActiveMailWnd(null);
        }
    }