Пример #1
0
    public void ActiveTenPetObtainPanel()
    {
        if (m_TenPetObtainPanel == null)
        {
            sdUILoading.ActiveSmallLoadingUI(true);
            ResLoadParams param = new ResLoadParams();
            sdResourceMgr.Instance.LoadResource("UI/Shop/$TenPetObtainPanel.prefab", LoadTenPetObtainPanel, param);
            return;
        }

        m_TenPetObtainPanel.transform.FindChild("Item0").gameObject.SetActive(false);
        m_TenPetObtainPanel.transform.FindChild("Item1").gameObject.SetActive(false);
        m_TenPetObtainPanel.transform.FindChild("Item2").gameObject.SetActive(false);
        m_TenPetObtainPanel.transform.FindChild("Item3").gameObject.SetActive(false);
        m_TenPetObtainPanel.transform.FindChild("Item4").gameObject.SetActive(false);
        m_TenPetObtainPanel.transform.FindChild("Item5").gameObject.SetActive(false);
        m_TenPetObtainPanel.transform.FindChild("Item6").gameObject.SetActive(false);
        m_TenPetObtainPanel.transform.FindChild("Item7").gameObject.SetActive(false);
        m_TenPetObtainPanel.transform.FindChild("Item8").gameObject.SetActive(false);
        m_TenPetObtainPanel.transform.FindChild("Item9").gameObject.SetActive(false);

        if (m_tenPetObtainPanelOpen == false)
        {
            WndAni.ShowWndAni(m_TenPetObtainPanel, false, "bg_grey");
        }
        else
        {
            m_TenPetObtainPanel.GetComponent <TenPetObtainPanel>().RefreshPanel();
        }

        m_TenPetObtainPanel.SetActive(true);
        m_tenPetObtainPanelOpen = true;
    }
Пример #2
0
    public void ActiveOnePetObtainPanel(int iBuyPetType, uint uiTemplateID)
    {
        if (m_OnePetObtainPanel == null)
        {
            sdUILoading.ActiveSmallLoadingUI(true);
            ResLoadParams param = new ResLoadParams();
            param.petInt   = iBuyPetType;
            param.petData0 = uiTemplateID.ToString();
            sdResourceMgr.Instance.LoadResource("UI/Shop/$Old_OnePetObtainPanel.prefab", LoadOnePetObtainPanel, param);
            return;
        }

        if (m_onePetObtainPanelOpen == false)
        {
            _currBuyPetType = iBuyPetType;
            _currTemplateId = uiTemplateID;

            m_OnePetObtainPanel.transform.FindChild("root/Background").gameObject.SetActive(false);
            m_OnePetObtainPanel.transform.FindChild("root/ShowAttribute").gameObject.SetActive(false);
            m_OnePetObtainPanel.transform.FindChild("root/BtnBuyAgain0").gameObject.SetActive(false);
            m_OnePetObtainPanel.transform.FindChild("root/BtnBuyAgain2").gameObject.SetActive(false);
            m_OnePetObtainPanel.transform.FindChild("root/BtnBuyAgain3").gameObject.SetActive(false);
            m_OnePetObtainPanel.transform.FindChild("root/PetView").gameObject.SetActive(false);

            WndAni.ShowWndAni(m_OnePetObtainPanel, false, "bg_grey");
        }
        else
        {
            m_OnePetObtainPanel.GetComponent <OnePetObtainPanel>().RefreshPanel(iBuyPetType, uiTemplateID);
        }

        m_OnePetObtainPanel.SetActive(true);
        m_onePetObtainPanelOpen = true;
    }
Пример #3
0
    public void OpenPanel()
    {
        _bWndOpen = true;
        if (m_goWndRoot != null)
        {
            AwardCenterWnd.Instance.m_goWndRoot.SetActive(false);

            m_goWndRoot.SetActive(true);

            //m_goWndRoot.transform.FindChild("EverydayAward/DailySignView").gameObject.SetActive(false);
            WndAni.ShowWndAni(m_goWndRoot, true, "bg_grey");

            RefreshDailyAwardList(true);
        }
        else
        {
            sdUILoading.ActiveSmallLoadingUI(true);
            ResLoadParams param = new ResLoadParams();
            param.info = "EverydayAwardPanel";
            sdResourceMgr.Instance.LoadResource("UI/AwardCenter/$EverydayAwardWnd.prefab",
                                                OnPanelLoaded,
                                                param,
                                                typeof(GameObject));
        }
    }
Пример #4
0
    public void OpenPanel()
    {
        if (sdUICharacter.Instance.GetTownUI() != null)
        {
            sdUICharacter.Instance.GetTownUI().GetComponent <sdTown>().lockPanel.SetActive(true);
        }

        _bWndOpen = true;
        if (m_goWndRoot != null)
        {
            m_goWndRoot.SetActive(true);
            //WndAni.ShowWndAni(m_goWndRoot,false,"bg_grey");
            string[] btns = { "AwardFrame/btn_EverydayQuest", "AwardFrame/btn_EverydayAward", "AwardFrame/btn_LevelAward", "AwardFrame/btn_EverydayFoods", "AwardFrame/btn_ExchangeCode" };
            WndAni.ShowWndAni2(m_goWndRoot, btns);
        }
        else
        {
            sdUILoading.ActiveSmallLoadingUI(true);
            ResLoadParams param = new ResLoadParams();
            param.info = "AwardCenterPanel";
            sdResourceMgr.Instance.LoadResource("UI/AwardCenter/$AwardCenterWnd.prefab",
                                                OnAwardCenterPanelLoaded,
                                                param,
                                                typeof(GameObject));
        }
    }
Пример #5
0
    public void ActiveMainPanel(GameObject PreWnd, bool activeChargeTab)
    {
        if (m_MainPanel == null)
        {
            sdUILoading.ActiveSmallLoadingUI(true);
            ResLoadParams param = new ResLoadParams();
            param.userdata0 = activeChargeTab;
            sdResourceMgr.Instance.LoadResource("UI/Shop/$MallPanel.prefab", LoadMainPanel, param);
            return;
        }

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

        if (activeChargeTab)
        {
            m_MainPanel.GetComponent <MallPanel>().ActiveTab(MallPanel.TabName.TAB_NAME_CHARGE);
        }
        else
        {
            m_MainPanel.GetComponent <MallPanel>().ActiveTab(MallPanel.TabName.TAB_NAME_MALL);
        }

        WndAni.ShowWndAni(m_MainPanel, true, "w_black");
        //m_MainPanel.SetActive(true);
        //sdUICharacter.Instance.ShowFullScreenUI(true);
    }
Пример #6
0
    void OnClick()
    {
        UIButton btn = GetComponent <UIButton>();

        if (btn != null && !btn.enabled)
        {
            return;
        }

        if (btn.name == "pray_close")
        {
            if (sdMallManager.Instance.OnePetObtainPanelOb != null)
            {
                WndAni.HideWndAni(sdMallManager.Instance.OnePetObtainPanelOb, false, "bg_grey");
            }
        }
        else if (btn.name == "ShowAttribute")
        {
            sdUIPetControl.Instance.ActivePetSmallTip(null, (int)m_iPetId, 0, 1, new Vector3(0f, 0f, 0f));
        }
        else if (btn.name == "BtnBuyAgain3")
        {
            if (sdMallManager.Instance.OnePetObtainPanelOb != null)
            {
                sdMallManager.Instance.OnePetObtainPanelOb.SetActive(false);
            }
        }
    }
Пример #7
0
    //图鉴弹出的宠物属性界面..
    public void ActivePetTujianSmallTip(GameObject PreWnd, int iID, int iUp, int iLevel)
    {
        if (m_UIPetPropPnl == null)
        {
            sdUILoading.ActiveSmallLoadingUI(true);
            ResLoadParams param = new ResLoadParams();
            param.petData0 = iID.ToString();
            param.petData1 = iUp.ToString();
            param.petInt   = iLevel;
            sdResourceMgr.Instance.LoadResource("UI/PetSys/$PetPropPnl.prefab", LoadPetTujianSmallTip, param);
            return;
        }

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

        m_UIPetPropPnl.SetActive(true);
        m_UIPetPropPnl.transform.parent        = sdGameLevel.instance.UICamera.transform;
        m_UIPetPropPnl.transform.localScale    = new Vector3(1.0f, 1.0f, 1.0f);
        m_UIPetPropPnl.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f);
        //窗口显示的效果..
        WndAni.ShowWndAni(m_UIPetPropPnl, false, "bg_grey");

        sdUIPetPropPnl obj = m_UIPetPropPnl.GetComponentInChildren <sdUIPetPropPnl>();

        if (obj != null)
        {
            obj.ActivePetPropTujianTip(PreWnd, iID, iUp, iLevel);
        }
    }
Пример #8
0
    //邮件详细界面..
    public void ActiveMailDetailWnd(GameObject PreWnd, UInt64 uuID)
    {
        if (m_UIMailDetailWnd == null)
        {
            sdUILoading.ActiveSmallLoadingUI(true);
            ResLoadParams param = new ResLoadParams();
            param.userdata0 = PreWnd as object;
            param.info      = uuID.ToString();
            sdResourceMgr.Instance.LoadResource("UI/UIPrefab/$MailDetailWnd.prefab", LoadMailDetailWnd, param, typeof(GameObject));
            return;
        }

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

        m_UIMailDetailWnd.SetActive(true);
        m_UIMailDetailWnd.transform.parent        = sdGameLevel.instance.UICamera.transform;
        m_UIMailDetailWnd.transform.localScale    = new Vector3(1.0f, 1.0f, 1.0f);
        m_UIMailDetailWnd.transform.localPosition = new Vector3(0.0f, 0.0f, -500.0f);
        //窗口显示的效果..
        WndAni.ShowWndAni(m_UIMailDetailWnd, false, "bg_grey");

        sdUIMailDetailWnd obj = m_UIMailDetailWnd.GetComponent <sdUIMailDetailWnd>();

        if (obj != null)
        {
            obj.ActiveMailDetailWnd(PreWnd, uuID);
        }
    }
Пример #9
0
 public void OnLvPanelClose()
 {
     //lvupPanel.SetActive(false);
     WndAni.HideWndAni(lvupPanel, false, "");
     showLv = false;
     scorePanel.SetActive(true);
 }
Пример #10
0
    void OnClick()
    {
        UIButton btn = GetComponent <UIButton>();

        if (btn != null && !btn.enabled)
        {
            return;
        }

        if (btn.name == "Close")
        {
            if (sdMallManager.Instance.TenPetObtainPanelOb != null)
            {
                //	sdMallManager.Instance.TenPetObtainPanelOb.SetActive(false);
                WndAni.HideWndAni(sdMallManager.Instance.TenPetObtainPanelOb, false, "bg_grey");
                sdMallManager.Instance.m_tenPetObtainPanelOpen = false;
            }
        }
        else if (btn.name == "ExchangeAgain")
        {
            if (sdMallManager.Instance.TenPetObtainPanelOb != null)
            {
                sdMallManager.Instance.TenPetObtainPanelOb.SetActive(false);
            }
        }
    }
Пример #11
0
 void ShowLevelReward(string boxidx)
 {
     if (m_LevelRewardWnd == null)
     {
         if (m_isLoadLevelRewardWnd)
         {
             return;
         }
         ResLoadParams param = new ResLoadParams();
         param.info = boxidx;
         sdResourceMgr.Instance.LoadResource("UI/LevelUI/$LevelRewardWnd.prefab", LoadWnd, param);
         m_isLoadLevelRewardWnd = true;
     }
     else
     {
         WndAni.ShowWndAni(m_LevelRewardWnd, false, "sp_grey");
         //m_LevelRewardWnd.SetActive(true);
         m_CampaignMgr.ShowBoxFX(false, m_LevelRewardWnd);
         if (boxidx == "bt_reward1")
         {
             m_LevelRewardWnd.GetComponent <LevelReward>().ShowLevelRewardWnd(m_CampaignMgr.m_RewardBox1, m_CampaignMgr.m_BattleStars);
         }
         else if (boxidx == "bt_reward2")
         {
             m_LevelRewardWnd.GetComponent <LevelReward>().ShowLevelRewardWnd(m_CampaignMgr.m_RewardBox2, m_CampaignMgr.m_BattleStars);
         }
         else if (boxidx == "bt_reward3")
         {
             m_LevelRewardWnd.GetComponent <LevelReward>().ShowLevelRewardWnd(m_CampaignMgr.m_RewardBox3, m_CampaignMgr.m_BattleStars);
         }
     }
 }
Пример #12
0
    //宠物战队..
    public void ActivePetWarPnl(GameObject PreWnd, int TeamIdx)
    {
        if (m_UIPetWarPnl == null)
        {
            sdUILoading.ActiveSmallLoadingUI(true);
            ResLoadParams param = new ResLoadParams();
            param.userdata0 = PreWnd as object;
            param.userdata1 = TeamIdx;
            sdResourceMgr.Instance.LoadResource("UI/PetSys/$PetWarPnl.prefab", LoadPetWarPnl, param);
            return;
        }

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

        m_UIPetWarPnl.SetActive(true);
        m_UIPetWarPnl.transform.parent        = sdGameLevel.instance.UICamera.transform;
        m_UIPetWarPnl.transform.localScale    = new Vector3(1.0f, 1.0f, 1.0f);
        m_UIPetWarPnl.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f);
        //窗口显示的效果..
        WndAni.ShowWndAni(m_UIPetWarPnl, true, "w_black");

        sdUIPetWarPnl obj = m_UIPetWarPnl.GetComponentInChildren <sdUIPetWarPnl>();

        if (obj != null)
        {
            obj.ActivePetWarPnl(PreWnd, TeamIdx);
        }
    }
Пример #13
0
    public void OpenPanel()
    {
        _bWndOpen = true;

        if (m_goWndRoot != null)
        {
            AwardCenterWnd.Instance.m_goWndRoot.SetActive(false);

            m_goWndRoot.SetActive(true);
            WndAni.ShowWndAni(m_goWndRoot, true, "bg_grey");

            m_goWndRoot.transform.FindChild("EverydayFoods/Eat/Empty").gameObject.SetActive(false);
            m_goWndRoot.transform.FindChild("EverydayFoods/Eat/FullCake").gameObject.SetActive(false);
            m_goWndRoot.transform.FindChild("EverydayFoods/Eat/FullChicken").gameObject.SetActive(false);

            _receiveEpAck = false;
            CliProto.CS_GIFT_EP_INFO_REQ netMsg = new CliProto.CS_GIFT_EP_INFO_REQ();
            SDNetGlobal.SendMessage(netMsg);
        }
        else
        {
            sdUILoading.ActiveSmallLoadingUI(true);
            ResLoadParams param = new ResLoadParams();
            param.info = "EverydayFoodsPanel";
            sdResourceMgr.Instance.LoadResource("UI/AwardCenter/$EverydayFoodsWnd.prefab",
                                                OnPanelLoaded,
                                                param,
                                                typeof(GameObject));
        }
    }
Пример #14
0
    public void CloseAwardCenterPanel()
    {
        if (m_goWndRoot == null)
        {
            return;
        }

        WndAni.HideWndAni2(m_goWndRoot);
        //WndAni.HideWndAni(m_goWndRoot,false,"bg_grey");
        //m_goWndRoot.SetActive(false);
    }
Пример #15
0
    private void OnCloseBtnClicked()
    {
        m_isPanelOpen = false;

        //transform.FindChild("Mall/PanelMall/Panel").gameObject.SetActive(false);
        //transform.FindChild("VIP/PanelVIP/Panel").gameObject.SetActive(false);

        WndAni.HideWndAni(this.gameObject, true, "w_black");

        //gameObject.SetActive (false);
        //sdUICharacter.Instance.ShowFullScreenUI (false);
    }
Пример #16
0
    void OnClick()
    {
        if (gameObject.name == "btnClose")
        {
            if (sdUIPetControl.m_UIPetSmallTip != null)
            {
                // sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetSmallTip);
                WndAni.HideWndAni(sdUIPetControl.m_UIPetSmallTip, false, "bg_grey");
            }

            if (m_preWnd)
            {
                m_preWnd.SetActive(true);
            }
        }
        else if (gameObject.name == "tab_jn")
        {
            GameObject wnd = GameObject.Find("NGUIRoot");
            if (wnd)
            {
                sdUIPetSmallTip petPnl = wnd.GetComponentInChildren <sdUIPetSmallTip>();
                if (petPnl)
                {
                    petPnl.ShowLeftPanBookUI(true);
                }
            }
        }
        else if (gameObject.name == "tab_sx")
        {
            GameObject wnd = GameObject.Find("NGUIRoot");
            if (wnd)
            {
                sdUIPetSmallTip petPnl = wnd.GetComponentInChildren <sdUIPetSmallTip>();
                if (petPnl)
                {
                    petPnl.ShowLeftPanBookUI(false);
                }
            }
        }
        else if (gameObject.name == "$PetSmallTip(Clone)")
        {
            GameObject wnd = sdGameLevel.instance.NGUIRoot;
            if (wnd)
            {
                sdUIPetSmallTip petPnl = wnd.GetComponentInChildren <sdUIPetSmallTip>();
                if (petPnl)
                {
                    sdConfDataMgr.Instance().OnModelClickRandomPlayAnm(petPnl.GetPetModel());
                }
            }
        }
    }
Пример #17
0
    public void ClosePanel()
    {
        if (m_goWndRoot == null)
        {
            return;
        }

        _bWndOpen = false;

        AwardCenterWnd.Instance.m_goWndRoot.SetActive(true);

        //m_goWndRoot.SetActive(false);
        WndAni.HideWndAni(m_goWndRoot, true, "bg_grey");
    }
Пример #18
0
    public void ShowRelive()
    {
        if (relive.activeSelf)
        {
            return;
        }
        WndAni.ShowWndAni(relive, false, "sp_grey");
        int maxReliveNum = sdLevelInfo.ReliveLimit(sdUICharacter.Instance.iCurrentLevelID);
        int curReliveNum = maxReliveNum - sdUICharacter.Instance.ReliveNum();

        relive.transform.FindChild("lb_times").GetComponent <UILabel>().text = string.Format(sdConfDataMgr.Instance().GetShowStr("ReliveNum2"), curReliveNum, maxReliveNum);
        relive.transform.FindChild("lb_cost").GetComponent <UILabel>().text  = sdUICharacter.Instance.RelivePrice().ToString();

        //if (relive != null) relive.SetActive(true);
    }
Пример #19
0
    public void ClosePanel()
    {
        if (m_goWndRoot == null)
        {
            return;
        }

        _bWndOpen = false;

        AwardCenterWnd.Instance.m_goWndRoot.SetActive(true);

        //m_goWndRoot.SetActive(false);
        m_goWndRoot.transform.FindChild("EverydayAward/DailySignView").gameObject.SetActive(false);
        WndAni.HideWndAni(m_goWndRoot, true, "bg_grey");
    }
Пример #20
0
    void OnClick()
    {
        if (gameObject.name == "btnClose")
        {
            if (sdUIPetControl.m_UIPetSkillTip != null)
            {
                //sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetSkillTip);
                WndAni.HideWndAni(sdUIPetControl.m_UIPetSkillTip, false, "bg_grey");
            }

            if (m_preWnd)
            {
                m_preWnd.SetActive(true);
            }
        }
    }
Пример #21
0
    void OnClick()
    {
        UIButton btn = GetComponent <UIButton> ();

        if (btn != null && !btn.enabled)
        {
            return;
        }

        if (btn.name == "Close")
        {
            WndAni.HideWndAni(m_panelRoot, true, "w_black");
            //m_panelRoot.SetActive(false);
            //sdUICharacter.Instance.ShowFullScreenUI(false);
        }
    }
Пример #22
0
 void ShowChooseFriendPet()
 {
     if (m_ChooseFriendPetWnd == null)
     {
         if (m_isLoadChooseFriendPetWnd)
         {
             return;
         }
         ResLoadParams param = new ResLoadParams();
         sdResourceMgr.Instance.LoadResource("UI/LevelUI/$ChooseFriendPetWnd.prefab", LoadWnd, param);
         m_isLoadChooseFriendPetWnd = true;
     }
     else
     {
         WndAni.ShowWndAni(m_ChooseFriendPetWnd, false, "sp_grey");
         //m_ChooseFriendPetWnd.SetActive(true);
     }
 }
Пример #23
0
    public void ActiveMagicTowerPanel(GameObject PreWnd)
    {
        if (m_magicTowerPanel == null)
        {
            sdUILoading.ActiveSmallLoadingUI(true);
            ResLoadParams param = new ResLoadParams();
            sdResourceMgr.Instance.LoadResource("UI/Shop/$MagicTowerPanel.prefab", OnMagicTowerPanelLoaded, param);
            return;
        }

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

        WndAni.ShowWndAni(m_magicTowerPanel, true, "w_black");
        //m_magicTowerPanel.SetActive(true);
        //sdUICharacter.Instance.ShowFullScreenUI(true);
    }
Пример #24
0
    void OnClick()
    {
        if (gameObject.name == "btn_close")
        {
            if (Application.loadedLevelName == "$worldmap_0" || Application.loadedLevelName == "$mainCity_1")
            {                   // 在城镇中...
                sdUICharacter.Instance.HideTuitu(false);

                //if( m_wndCampaign ) m_wndCampaign.SetActive(false);
                //sdUICharacter.Instance.ShowFullScreenUI(false);
            }
            else
            {                   // 在关卡中...
                GameObject obj = GameObject.Find("Fx_lingjing01");
                if (obj != null)
                {
                    obj.SetActive(false);
                }
                obj = GameObject.Find("Fx_lingjing02");
                if (obj != null)
                {
                    obj.SetActive(false);
                }
                obj = GameObject.Find("Fx_lingjing03");
                if (obj != null)
                {
                    obj.SetActive(false);
                }

                sdUICharacter.Instance.TuiTu_To_WorldMap();
            }
        }
        else if (gameObject.name == "btn_rewardclose")
        {
            WndAni.HideWndAni(m_wndCampaign, false, "sp_grey");
            //m_wndCampaign.SetActive(false);
        }
        else if (gameObject.name == "btn_fpetclose")
        {
            WndAni.HideWndAni(m_wndCampaign, false, "sp_grey");
            //m_wndCampaign.SetActive(false);
        }
    }
Пример #25
0
    //宠物背包..
    public void ActivePetListPnl(GameObject PreWnd, bool bNeedScale)
    {
        if (m_UIPetListPnl == null)
        {
            sdUILoading.ActiveSmallLoadingUI(true);
            ResLoadParams param = new ResLoadParams();
            param.userdata0 = PreWnd as object;
            if (bNeedScale)
            {
                param.petInt = 1;
            }
            else
            {
                param.petInt = 0;
            }
            sdResourceMgr.Instance.LoadResource("UI/PetSys/$PetListPnl.prefab", LoadPetListPnl, param, typeof(GameObject));
            return;
        }

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

        m_UIPetListPnl.SetActive(true);
        m_UIPetListPnl.transform.parent        = sdGameLevel.instance.UICamera.transform;
        m_UIPetListPnl.transform.localScale    = new Vector3(1.0f, 1.0f, 1.0f);
        m_UIPetListPnl.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f);
        //窗口显示的效果..
        if (bNeedScale)
        {
            WndAni.ShowWndAni(m_UIPetListPnl, true, "w_black");
        }

        sdUIPetListPnl obj = m_UIPetListPnl.GetComponent <sdUIPetListPnl>();

        if (obj != null)
        {
            obj.ActivePetListPnl(PreWnd);
        }
    }
Пример #26
0
    public void OpenPanel()
    {
        _bWndOpen = true;
        if (m_goWndRoot != null)
        {
            AwardCenterWnd.Instance.m_goWndRoot.SetActive(false);

            m_goWndRoot.SetActive(true);
            WndAni.ShowWndAni(m_goWndRoot, true, "bg_grey");
        }
        else
        {
            sdUILoading.ActiveSmallLoadingUI(true);
            ResLoadParams param = new ResLoadParams();
            param.info = "ExchangeCodePanel";
            sdResourceMgr.Instance.LoadResource("UI/AwardCenter/$ExchangeCodeWnd.prefab",
                                                OnPanelLoaded,
                                                param,
                                                typeof(GameObject));
        }
    }
Пример #27
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);
                    }
                }
            }
        }
    }
Пример #28
0
    public static void DoCloseClick(string strName)
    {
        //宠物列表界面..
        if (strName == "petListClose")
        {
            if (sdUIPetControl.m_UIPetListPnl != null)
            {
                //sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetListPnl);
                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 (strName == "saleSelectClose")
        {
            if (sdUIPetControl.m_UIPetSaleSelectPnl != null)
            {
                //sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetSaleSelectPnl);
                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 (strName == "rongheClose")
        {
            if (sdUIPetControl.m_UIPetRonghePnl != null)
            {
                //sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetRonghePnl);
                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 (strName == "rongheSelectClose")
        {
            if (sdUIPetControl.m_UIPetRongheSelectPnl != null)
            {
                //sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetRongheSelectPnl);
                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 (strName == "petTujianClose")
        {
            if (sdUIPetControl.m_UIPetTujianPnl != null)
            {
                //sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetTujianPnl);
                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 (strName == "petWarClose")
        {
            if (sdUIPetControl.m_UIPetWarPnl != null)
            {
                //sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetWarPnl);
                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 (strName == "warSelectClose")
        {
            if (sdUIPetControl.m_UIPetWarSelectPnl != null)
            {
                //sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetWarSelectPnl);
                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 (strName == "petPropClose")
        {
            if (sdUIPetControl.m_UIPetPropPnl != null)
            {
                //sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetPropPnl);
                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 (strName == "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);
                    }
                }
            }
        }

        //升级材料选择..
        else if (strName == "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);
                    }
                }
            }
        }

        //强化界面..
        else if (strName == "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);
                    }
                }
            }
        }

        //强化选择界面..
        else if (strName == "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);
                    }
                }
            }
        }
    }
Пример #29
0
    void LevelUp()
    {
        //lvUp.SetActive(true);
        scorePanel.SetActive(false);
        //lvupPanel.SetActive(true);
        WndAni.ShowWndAni(lvupPanel, false, "");

        string main = "";
        int    job  = int.Parse(sdGameLevel.instance.mainChar.BaseJob.ToString());

        switch (job)
        {
        case (int)HeaderProto.ERoleJob.ROLE_JOB_Warrior:
        {
            main = "Str";
            break;
        }

        case (int)HeaderProto.ERoleJob.ROLE_JOB_Magic:
        {
            main = "Int";
            break;
        }

        case (int)HeaderProto.ERoleJob.ROLE_JOB_Rogue:
        {
            main = "Dex";
            break;
        }

        case (int)HeaderProto.ERoleJob.ROLE_JOB_Minister:
        {
            main = "Fai";
            break;
        }
        }
        mainName.GetComponent <UILabel>().text = sdConfDataMgr.Instance().GetShowStr(main) + ":";
        mainPro.GetComponent <UILabel>().text  = "+" + sdUICharacter.Instance.lvupChange[main].ToString();

        attPro.GetComponent <UILabel>().text   = "+" + sdUICharacter.Instance.lvupChange["AttDmg"].ToString();
        defPro.GetComponent <UILabel>().text   = "+" + sdUICharacter.Instance.lvupChange["Def"].ToString();
        hpPro.GetComponent <UILabel>().text    = "+" + sdUICharacter.Instance.lvupChange["HP"].ToString();
        skillPro.GetComponent <UILabel>().text = "+" + sdUICharacter.Instance.lvupChange["Skill"].ToString();

        int compare = int.Parse(sdUICharacter.Instance.lvupChange["Level"].ToString());

        if (compare >= 10)
        {
            lvB0.GetComponent <UISprite>().spriteName = compare.ToString()[0].ToString();
            lvB1.GetComponent <UISprite>().spriteName = compare.ToString()[1].ToString();
        }
        else
        {
            lvB0.GetComponent <UISprite>().spriteName = compare.ToString()[0].ToString();
            lvB1.GetComponent <UISprite>().spriteName = "";
        }

        Hashtable info  = sdGlobalDatabase.Instance.globalData["MainCharBaseProp"] as Hashtable;
        int       level = int.Parse(info["Level"].ToString());

        if (level >= 10)
        {
            lvA0.GetComponent <UISprite>().spriteName = level.ToString()[0].ToString();
            lvA1.GetComponent <UISprite>().spriteName = level.ToString()[1].ToString();
        }
        else
        {
            lvA1.GetComponent <UISprite>().spriteName = level.ToString()[0].ToString();
            lvA0.GetComponent <UISprite>().spriteName = "";
        }
    }
Пример #30
0
 public void HideRelive()
 {
     WndAni.HideWndAni(relive, false, "sp_grey");
     //if (relive != null) relive.SetActive(false);
 }