示例#1
0
    private static void msg_SCID_OTHER_APPEAR(int iMsgID, ref CMessage msg)
    {
        CliProto.SC_OTHER_APPEAR refMSG = (CliProto.SC_OTHER_APPEAR)msg;
        if (refMSG == null)
        {
            return;
        }

        sdGameLevel gameLevel = sdGameLevel.instance;

        if (gameLevel == null)
        {
            Debug.Log("No gamelevel");
            return;
        }
        //如果不是主城  暂时不允许创建玩家..等服务器调整好之后再做处理..
        if (gameLevel.levelType != sdGameLevel.LevelType.MainCity)
        {
            Debug.Log(gameLevel.levelType.ToString() + " don't allow create sdOtherChar.");
            return;
        }
        for (int i = 0; i < refMSG.m_Count; ++i)
        {
            CliProto.SOtherInfoWithPos kOtherRoleInfo = refMSG.m_RoleInfo[i];

            float fX         = ServerPos2Client(kOtherRoleInfo.m_Pos.m_X);
            float fY         = ServerPos2Client(kOtherRoleInfo.m_Pos.m_Y);
            float fZ         = ServerPos2Client(kOtherRoleInfo.m_Pos.m_Z);
            float fDirection = ServerOri2Client(kOtherRoleInfo.m_Pos.m_Orientation);

            sdGameActorCreateInfo kInfo = new sdGameActorCreateInfo();
            kInfo.mDBID      = kOtherRoleInfo.m_RoleInfo.m_RoleInfo.m_RoleInfo.m_DBRoleId;
            kInfo.mObjID     = kOtherRoleInfo.m_RoleInfo.m_ObjID;
            kInfo.mGender    = kOtherRoleInfo.m_RoleInfo.m_RoleInfo.m_RoleInfo.m_Gender;
            kInfo.mHairStyle = kOtherRoleInfo.m_RoleInfo.m_RoleInfo.m_RoleInfo.m_HairStyle;
            kInfo.mSkinColor = kOtherRoleInfo.m_RoleInfo.m_RoleInfo.m_RoleInfo.m_SkinColor;
            kInfo.mBaseJob   = kOtherRoleInfo.m_RoleInfo.m_RoleInfo.m_RoleInfo.m_BaseJob;
            kInfo.mJob       = kOtherRoleInfo.m_RoleInfo.m_RoleInfo.m_RoleInfo.m_Job;
            kInfo.mLevel     = kOtherRoleInfo.m_RoleInfo.m_RoleInfo.m_RoleInfo.m_Level;
            kInfo.mRoleName  = System.Text.Encoding.UTF8.GetString(kOtherRoleInfo.m_RoleInfo.m_RoleInfo.m_RoleInfo.m_RoleName);

            sdOtherChar otherChar = sdGameLevel.instance.createOtherChar(
                kInfo,
                //new Vector3(0.0f, -1.4f, 35.5f),
                new Vector3(fX, fY, fZ),
                Quaternion.Euler(0, fDirection, 0));

            uint uiEquipCount = kOtherRoleInfo.m_RoleInfo.m_RoleInfo.m_Equip.m_ItemCount;
            if (otherChar != null && uiEquipCount > 0)
            {
                uint[] auiEquipArray = new uint[uiEquipCount];
                for (int j = 0; j < uiEquipCount; ++j)
                {
                    auiEquipArray[j] = (uint)kOtherRoleInfo.m_RoleInfo.m_RoleInfo.m_Equip.m_Items[j].m_TID;
                }

                otherChar.updateAvatar(auiEquipArray, uiEquipCount);
            }
        }
    }
示例#2
0
    private static void msg_SCID_OTHER_UPDATE(int iMsgID, ref CMessage msg)
    {
        CliProto.SC_OTHER_UPDATE refMSG = (CliProto.SC_OTHER_UPDATE)msg;
        if (refMSG == null)
        {
            return;
        }

        sdGameLevel gameLevel = sdGameLevel.instance;

        if (gameLevel == null)
        {
            return;
        }

        for (int i = 0; i < refMSG.m_Count; ++i)
        {
            CliProto.SOtherInfo kOtherRoleInfo = refMSG.m_RoleInfo[i];

            ulong       ulDBID       = kOtherRoleInfo.m_RoleInfo.m_RoleInfo.m_DBRoleId;
            sdOtherChar otherChar    = gameLevel.findOtherCharByDBID(ulDBID);
            uint        uiEquipCount = kOtherRoleInfo.m_RoleInfo.m_Equip.m_ItemCount;
            if (otherChar != null && uiEquipCount > 0)
            {
                uint[] auiEquipArray = new uint[uiEquipCount];
                for (int j = 0; j < uiEquipCount; ++j)
                {
                    auiEquipArray[j] = (uint)kOtherRoleInfo.m_RoleInfo.m_Equip.m_Items[j].m_TID;
                }

                otherChar.updateAvatar(auiEquipArray, uiEquipCount);
            }
        }
    }
示例#3
0
    public static sdGameLevel getCurrentLevel()
    {
        if (globalInterface.currentGameLevel != null)
        {
            return(globalInterface.currentGameLevel);
        }

        currentGameLevel = sdGameLevel.instance;
        return(currentGameLevel);
    }
示例#4
0
    public void OnClickStrongOk()
    {
        //属性变化的UI显示..
        SClientPetInfo Info = null;

        if (m_uuDBID == UInt64.MaxValue)
        {
            return;
        }

        Info = sdNewPetMgr.Instance.GetPetInfo(m_uuDBID);
        if (Info == null)
        {
            return;
        }

        if (Info.m_iUp >= sdNewPetMgr.MAX_PET_STRONG_LEVEL)
        {
            sdUICharacter.Instance.ShowOkMsg("该战魂已经强化到最高级别", null);
            return;
        }

        if (sdNewPetMgr.Instance.m_uuPetStrongSelectID == UInt64.MaxValue)
        {
            sdUICharacter.Instance.ShowOkMsg("请选择一个战魂作为强化材料", null);
            return;
        }

        //金钱不足判断..
        uint        uiMyMoney = 0;
        sdGameLevel level     = sdGameLevel.instance;

        if (level != null)
        {
            if (level.mainChar != null)
            {
                Hashtable prop = level.mainChar.GetProperty();
                uiMyMoney = (uint)prop["NonMoney"];
            }
        }
        if (m_iStrongMoney > uiMyMoney)
        {
            sdUICharacter.Instance.ShowOkMsg("没有足够的金币", null);
            return;
        }

        SendPetStrongMsg();
        sdNewPetMgr.Instance.m_uuPetStrongSelectID = UInt64.MaxValue;
        ReflashPetStrongIcon();
    }
示例#5
0
    private static void msg_SCID_SELF_ENTERSCENE(int iMsgID, ref CMessage msg)
    {
        CliProto.SC_SELF_ENTERSCENE refMSG = (CliProto.SC_SELF_ENTERSCENE)msg;
        SDGlobal.Log("<- SCID_SELF_ENTERSCENE : client start load scene!@ " + (System.DateTime.Now.Ticks / 10000L).ToString());

        // 获取同步时间aa
        sdGameLevel gameLevel = sdGameLevel.instance;

        if (gameLevel != null)
        {
            //gameLevel.ServerTime = refMSG.m_ServerTime;
            //gameLevel.ClientTime = (ulong)(System.DateTime.Now.Ticks / 10000L);//Time.time;
            sdGlobalDatabase.Instance.ServerBeginTime = refMSG.m_ServerTime;
        }
    }
示例#6
0
    // 更新主角展示模型aa
    public override void RefreshAvatar()
    {
        sdGameLevel gameLevel = sdGameLevel.instance;

        if (gameLevel == null || gameLevel.avatarCamera == null)
        {
            return;
        }

        if (gameLevel.avatarCamera.transform.childCount > 0)
        {
            Transform tt = gameLevel.avatarCamera.transform.GetChild(0);
            if (tt != null)
            {
                tt.parent = null;
                GameObject.Destroy(tt.gameObject);
            }
        }

        GameObject avatarNode = GameObject.Instantiate(this.renderNode) as GameObject;

        avatarNode.transform.parent        = gameLevel.avatarCamera.transform;
        avatarNode.transform.localPosition = new Vector3(0.15f, -0.75f, 2.0f);
        avatarNode.transform.localRotation = Quaternion.AngleAxis(180.0f, Vector3.up);
        avatarNode.transform.localScale    = Vector3.one;

        int avatarLayer = LayerMask.NameToLayer("AvatarNode");

        Transform[] renderData = avatarNode.GetComponentsInChildren <Transform>();
        foreach (Transform t in renderData)
        {
            t.gameObject.layer = avatarLayer;
        }

        Animation aniCtrl = avatarNode.GetComponent <Animation>();

        if (aniCtrl != null)
        {
            if (logicTSM.idle != null)
            {
                AnimationState aniState = aniCtrl[logicTSM.idle.info];
                if (aniState != null)
                {
                    aniCtrl.Play(logicTSM.idle.info);
                }
            }
        }
    }
示例#7
0
    private static void msg_SCID_MOVE_STOP(int iMsgID, ref CMessage msg)
    {
        CliProto.SC_MOVE_STOP refMSG = (CliProto.SC_MOVE_STOP)msg;
        if (refMSG == null)
        {
            return;
        }

        sdGameLevel gameLevel = sdGameLevel.instance;

        if (gameLevel == null)
        {
            return;
        }

        for (int i = 0; i < refMSG.m_Count; ++i)
        {
            CliProto.SMoveObj kMoveObj = refMSG.m_Objs[i];

            ulong       ulObjID   = kMoveObj.m_ObjectID;
            sdOtherChar otherChar = gameLevel.findOtherCharByObjID(ulObjID);
            if (otherChar != null)
            {
                sdSynMovePacket kMovePacket = new sdSynMovePacket();

                kMovePacket.mIsEnd       = true;
                kMovePacket.mPosX        = ServerPos2Client(kMoveObj.m_Position.m_X);
                kMovePacket.mPosY        = ServerPos2Client(kMoveObj.m_Position.m_Y);
                kMovePacket.mPosZ        = ServerPos2Client(kMoveObj.m_Position.m_Z);
                kMovePacket.mOrientation = ServerOri2Client(kMoveObj.m_Position.m_Orientation);

                ulong ulDeltaTime = kMoveObj.m_Time - sdGlobalDatabase.Instance.ServerBeginTime;
                kMovePacket.mSendTime = gameLevel.ClientTime + (float)ulDeltaTime / 1000.0f;
                kMovePacket.mRecvTime = System.DateTime.Now.Ticks / 10000L * 0.001f;                //Time.time;

                otherChar.PushSynPacket(kMovePacket);

//				string kMsg = "-> SC_MOVE_END: "
//					+ ulObjID + ";"
//					+ kMovePacket.mPosX.ToString() + ","
//					+ kMovePacket.mPosY.ToString() + ","
//					+ kMovePacket.mPosZ.ToString() + ";"
//					+ kMovePacket.mOrientation.ToString();
//				SDGlobal.Log(kMsg);
            }
        }
    }
示例#8
0
    private static void msg_SCID_OTHER_DISAPPEAR(int iMsgID, ref CMessage msg)
    {
        CliProto.SC_OTHER_DISAPPEAR refMSG = (CliProto.SC_OTHER_DISAPPEAR)msg;
        if (refMSG == null)
        {
            return;
        }

        sdGameLevel gameLevel = sdGameLevel.instance;

        if (gameLevel == null)
        {
            return;
        }

        for (int i = 0; i < refMSG.m_Count; ++i)
        {
            ulong ulObj = refMSG.m_ObjID[i];
            sdGameLevel.instance.removeOtherCharByObjID(ulObj);
        }
    }
示例#9
0
    private static void msg_SCID_SELF_VOLATILE_PRO(int iMsgID, ref CMessage msg)
    {
        CliProto.SC_SELF_VOLATILE_PRO refMSG = (CliProto.SC_SELF_VOLATILE_PRO)msg;
        if (sdGlobalDatabase.Instance.globalData["MainCharBaseProp"] != null)
        {
            ((Hashtable)sdGlobalDatabase.Instance.globalData["MainCharBaseProp"])["NonMoney"]   = refMSG.m_NonMoney;
            ((Hashtable)sdGlobalDatabase.Instance.globalData["MainCharBaseProp"])["NonCash"]    = refMSG.m_NonCash;
            ((Hashtable)sdGlobalDatabase.Instance.globalData["MainCharBaseProp"])["Cash"]       = refMSG.m_Cash;
            ((Hashtable)sdGlobalDatabase.Instance.globalData["MainCharBaseProp"])["EP"]         = refMSG.m_EP;
            ((Hashtable)sdGlobalDatabase.Instance.globalData["MainCharBaseProp"])["Experience"] = refMSG.m_Experience;
            ((Hashtable)sdGlobalDatabase.Instance.globalData["MainCharBaseProp"])["AP"]         = refMSG.m_AP;
            sdGameLevel level = sdGameLevel.instance;
            if (level != null)
            {
                if (level.mainChar != null)
                {
                    Hashtable prop = sdConfDataMgr.CloneHashTable(((Hashtable)sdGlobalDatabase.Instance.globalData["MainCharBaseProp"]));
                    prop["HP"] = level.mainChar["HP"];
                    prop["SP"] = level.mainChar["SP"];
                    level.mainChar.Property = prop;
                    level.mainChar.RefreshProp();
                    Debug.Log("msg_SCID_SELF_VOLATILE_PRO");
                }

                GameObject wnd = sdGameLevel.instance.NGUIRoot;
                if (wnd)
                {
                    sdUILapBossWnd lapBossWnd = wnd.GetComponentInChildren <sdUILapBossWnd>();
                    if (lapBossWnd)
                    {
                        lapBossWnd.UpdateLapBossUI();
                    }
                }
            }
        }

        sdMallManager.Instance.RefreshAttribute();
    }
示例#10
0
    public static void send_CSID_SCID_MOVE_STOP(Vector3 kPos, float fOri, float fTime)
    {
        CliProto.CS_MOVE_STOP refMSG = new CliProto.CS_MOVE_STOP();

        sdGameLevel gameLevel  = sdGameLevel.instance;
        float       fDeltaTime = fTime - gameLevel.ClientTime;

        refMSG.m_Time = (ulong)(fDeltaTime * 1000) + sdGlobalDatabase.Instance.ServerBeginTime;;

        refMSG.m_Position.m_X           = ClientPos2Server(kPos.x);
        refMSG.m_Position.m_Y           = ClientPos2Server(kPos.y);
        refMSG.m_Position.m_Z           = ClientPos2Server(kPos.z);
        refMSG.m_Position.m_Orientation = ClientOri2Server(fOri);

        SDNetGlobal.SendMessage(refMSG);

//		string kMsg = "-> CS_MOVE_STOP: "
//			+ kPos.x.ToString() + ","
//			+ kPos.y.ToString() + ","
//			+ kPos.z.ToString() + ";"
//			+ fOri.ToString();
//		SDGlobal.Log(kMsg);
    }
示例#11
0
    void Start()
    {
        GameObject panel = GameObject.Find("skillpanel");

        if (panel == null)
        {
            return;
        }

        Hashtable table = sdConfDataMgr.Instance().GetSkillList();

        if (table == null)
        {
            return;
        }

        Hashtable alineCount = new Hashtable();
        Hashtable plineCount = new Hashtable();

        string      jobClass  = "1";
        sdGameLevel gameLevel = sdGameLevel.instance;

        if (gameLevel && gameLevel.mainChar != null && gameLevel.mainChar.Property != null)
        {
            jobClass = ((int)gameLevel.mainChar.GetJob()).ToString();
        }

        foreach (DictionaryEntry item in table)
        {
            Hashtable skill = item.Value as Hashtable;
            string    job   = skill["byJob"].ToString();
            if (job != jobClass)
            {
                continue;
            }

            int    active = int.Parse(skill["byIsPassive"].ToString());
            string x      = skill["strName"].ToString();
            int    index  = int.Parse(skill["Index"].ToString());
            if (active == 1)
            {
//				int line = int.Parse(skill["ParentID"].ToString());
//				if (line != 1001) continue;
//				string name = "passive"+index.ToString();
//				Transform icon = panel.transform.FindChild(name);
//				if (icon != null)
//				{
//					icon.FindChild("icon").GetComponent<UISprite>().spriteName = skill["icon"].ToString();
//				}
            }
            else
            {
                string    name = "skill" + (index + 1).ToString();
                Transform icon = panel.transform.FindChild(name);
                if (icon != null)
                {
                    if (index == 2)
                    {
                        sdUICharacter.Instance.ShowSkillInfo(skill["uid"].ToString());
                    }

                    string iconname = skill["icon"].ToString();
                    icon.GetComponent <UISprite>().spriteName = skill["icon"].ToString();
                    icon.GetComponent <sdSkillIcon>().skillId = skill["uid"].ToString();

                    if (sdGameSkillMgr.Instance.GetSkill(int.Parse(skill["uid"].ToString())) == null)
                    {
                        icon.FindChild("lock").GetComponent <UISprite>().spriteName = "lock";
                        icon.GetComponent <UISprite>().alpha = 0.5f;
                    }
                    else
                    {
                        icon.FindChild("lock").GetComponent <UISprite>().spriteName = "";
                        icon.GetComponent <UISprite>().alpha = 1f;
                    }
                }
            }
        }

        Refresh();
    }
示例#12
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);
                    }
                }
            }
        }
    }
示例#13
0
    private static void msg_SCID_SELF_BASE_PRO(int iMsgID, ref CMessage msg)
    {
        CliProto.SC_SELF_BASE_PRO refMSG = (CliProto.SC_SELF_BASE_PRO)msg;

        if (refMSG != null)
        {
            refMSG.m_HP = refMSG.m_MaxHP;
            refMSG.m_SP = refMSG.m_MaxSP;
            Hashtable charProps = new Hashtable();
            charProps["HurtOtherModify"] = 0;
            charProps["PhysicsModify"]   = 0;
            charProps["IceModify"]       = 0;
            charProps["FireModify"]      = 0;
            charProps["PoisonModify"]    = 0;
            charProps["ThunderModify"]   = 0;
            charProps["StayModify"]      = 0;
            charProps["HoldModify"]      = 0;
            charProps["StunModify"]      = 0;
            charProps["BeHurtModify"]    = 0;

            MemberInfo[] propInfo = refMSG.GetDesc();
            for (int i = 0; i < propInfo.Length; ++i)
            {
                object val = refMSG.GetMemberValue(i);
                if (propInfo[i].name == "RoleIndex")
                {
                    int value = (int)val;
                    value += 100000;
                    charProps[propInfo[i].name] = value;
                }
                else
                {
                    charProps[propInfo[i].name] = val;
                }
            }
            //charProps["NonCash"] = uint.MinValue;
            Hashtable compareTable = sdGlobalDatabase.Instance.globalData["MainCharBaseProp"] as Hashtable;
            if (compareTable != null)
            {
                if (compareTable["Level"].ToString() != charProps["Level"].ToString())
                {
                    if (sdUICharacter.Instance.lvupChange.Contains("Level"))
                    {
                        sdUICharacter.Instance.lvupChange["Level"] = compareTable["Level"].ToString();
                    }
                    else
                    {
                        sdUICharacter.Instance.lvupChange.Add("Level", compareTable["Level"].ToString());
                    }

                    int change = 0;

                    int attdmg     = int.Parse(charProps["AtkDmgMin"].ToString()) + int.Parse(charProps["AtkDmgMax"].ToString());
                    int attcompare = int.Parse(compareTable["AtkDmgMin"].ToString()) + int.Parse(compareTable["AtkDmgMax"].ToString());
                    change = (attdmg - attcompare) / 2;
                    if (sdUICharacter.Instance.lvupChange.Contains("AttDmg"))
                    {
                        sdUICharacter.Instance.lvupChange["AttDmg"] = change;
                    }
                    else
                    {
                        sdUICharacter.Instance.lvupChange.Add("AttDmg", change);
                    }

                    int def        = int.Parse(charProps["Def"].ToString());
                    int defcompare = int.Parse(compareTable["Def"].ToString());
                    change = def - defcompare;
                    if (sdUICharacter.Instance.lvupChange.Contains("Def"))
                    {
                        sdUICharacter.Instance.lvupChange["Def"] = change;
                    }
                    else
                    {
                        sdUICharacter.Instance.lvupChange.Add("Def", change);
                    }

                    int hp        = int.Parse(charProps["HP"].ToString());
                    int hpcompare = int.Parse(compareTable["HP"].ToString());
                    change = hp - hpcompare;
                    if (sdUICharacter.Instance.lvupChange.Contains("HP"))
                    {
                        sdUICharacter.Instance.lvupChange["HP"] = change;
                    }
                    else
                    {
                        sdUICharacter.Instance.lvupChange.Add("HP", change);
                    }

                    string main = "";
                    int    job  = int.Parse(charProps["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;
                    }
                    }
                    int mainValue   = int.Parse(charProps[main].ToString());
                    int maincompare = int.Parse(compareTable[main].ToString());
                    change = mainValue - maincompare;

                    sdUICharacter.Instance.lvupChange[main] = change;
                }
            }

            sdGlobalDatabase.Instance.globalData["MainCharBaseProp"] = charProps;

            sdGameLevel level = sdGameLevel.instance;
            if (level != null)
            {
                if (level.mainChar != null)
                {
                    Hashtable prop = sdConfDataMgr.CloneHashTable(charProps);
                    prop["HP"] = level.mainChar["HP"];
                    prop["SP"] = level.mainChar["SP"];
                    level.mainChar.Property = prop;
                    level.mainChar.RefreshProp();
                }
            }
        }

        if (sdGameLevel.instance != null && sdGameLevel.instance.mainChar != null)
        {
            sdGameLevel.instance.mainChar.AddSuitBuff();
            sdGameLevel.instance.mainChar.RefreshProp();
        }

        if (sdUICharacter.Instance.playerScore > 0)
        {
            int score = sdConfDataMgr.Instance().PlayerScore();
            if (score > sdUICharacter.Instance.playerScore)
            {
                sdUICharacter.Instance.ShowScorePanel(sdUICharacter.Instance.playerScore, score);
                sdUICharacter.Instance.playerScore = score;
            }
        }
    }
示例#14
0
    public void checkHitPoint(sdGameActor _gameActor)
    {
        if (_gameActor == null || _gameActor.AnimController == null || stateData == null)
        {
            return;
        }
        AnimationState aniStateTemp = aniState;

        if (aniStateTemp == null)
        {
            return;
        }
        if (stateData.ContainsKey("hitPoint"))
        {
            bool  shakeCamera = ((int)stateData["shakeCamera"] == 1);
            float shakelevel  = ((int)stateData["ShakeLevel"]) * 0.0001f;

            object  hitPointData = stateData["hitPoint"];
            float[] hitPoints    = null;
            if (hitPointData.GetType().IsArray)
            {
                hitPoints = (float[])hitPointData;
            }
            else
            {
                hitPoints = new float[1] {
                    (float)hitPointData
                };
            }
            float fCompareTime = aniStateTemp.normalizedTime;
            fCompareTime -= Mathf.Floor(fCompareTime);
            for (int k = 0; k < hitPoints.Length; ++k)
            {
                float testPoint = hitPoints[k] * 0.0001f;

                if (testPoint > _gameActor.PreviousTime && testPoint <= fCompareTime)
                {
                    if (sdGameLevel.instance != null && sdGameLevel.instance.battleSystem != null)
                    {
                        OnAttack(_gameActor, k);

                        AddSkillEffect(
                            _gameActor,
                            HeaderProto.ESkillTimingConditionType.SKILL_TIMING_CONDITION_TYPE_HIT,
                            k + 1,
                            skillEffect,
                            skillEffectHitPoint,
                            null,
                            ((int)stateData["ParentID"]) / 100);


                        CallStateEvent(eStateEventType.eSET_hit);

                        sdGameLevel level = sdGameLevel.instance;
                        if (level != null && shakeCamera)
                        {
                            level.mainCamera.addRandomCameraShake(0.3f, 0.3f * shakelevel, 60.0f, 3.0f);
                        }
                    }
                    if (k == (hitPoints.Length - 1))
                    {
                        bAllHitPointDone = true;
                    }
                }
            }
            _gameActor.PreviousTime = fCompareTime;
        }
        else
        {
            bAllHitPointDone = true;
        }
    }
示例#15
0
    void Update()
    {
        if (sdUICharacter.Instance.IsFight)
        {
            sdUICharacter.Instance.fightTime += Time.deltaTime;
        }

        if (newSkill != null && newSkill.active && newSkill.GetComponent <Animator>().enabled&&
            newSkill.transform.localScale.x == 2)
        {
            curSkill.transform.position = newSkill.transform.position;
            curSkill.GetComponent <TweenPosition>().from = curSkill.transform.localPosition;
            curSkill.SetActive(true);
            newSkill.SetActive(false);
        }

        UpdateCombo();
        int id = sdLevelInfo.GetCurLevelId();

        // 大BOSS血条的动态出现效果aa
        if (showTime >= 0)
        {
            showTime += Time.deltaTime;
        }

        if (showTime > 0 && showTime < 0.2)
        {
            Vector3 vec = monsterHp.transform.localPosition;
            vec.y = (float)(715 - 145 * showTime / 0.3);
            monsterHp.transform.localPosition = vec;
        }
        else if (showTime >= 0.2 && showTime < 0.3)
        {
            Vector3 vec = monsterHp.transform.localPosition;
            vec.y = (float)(570 + (145 * 0.3 * (showTime - 0.2) / 0.1));
            monsterHp.transform.localPosition = vec;
        }
        else if (showTime >= 0.3 && showTime < 0.4)
        {
            Vector3 vec = monsterHp.transform.localPosition;
            vec.y = (float)(613.5 - 43.5 * (showTime - 0.3) / 0.1);
            monsterHp.transform.localPosition = vec;
        }
        else if (showTime >= 0.4 && showTime < 0.45)
        {
            Vector3 vec = monsterHp.transform.localPosition;
            vec.y = (float)(570 + (145 * 0.05 * (showTime - 0.4) / 0.05));
            monsterHp.transform.localPosition = vec;
        }
        else if (showTime >= 0.45 && showTime < 0.5)
        {
            Vector3 vec = monsterHp.transform.localPosition;
            vec.y = (float)(577.25 - 7.25 * (showTime - 0.45) / 0.05);
            monsterHp.transform.localPosition = vec;
        }
        else
        {
            showTime = -1;
        }

        //
        sdGameLevel level = sdGameLevel.instance;

        if (level == null)
        {
            return;
        }

        if (!needUpdate && level.AutoMode == autoMode && fullMode == level.FullAutoMode)
        {
            return;
        }
        autoMode   = level.AutoMode;
        fullMode   = level.FullAutoMode;
        needUpdate = false;
        if (level.AutoMode)
        {
            atPanel.SetActive(true);
            mtPanel.SetActive(false);
            if (canAuto)
            {
                if (level.FullAutoMode)
                {
                    modeBtn1.SetActive(true);
                    modeBtn2.SetActive(false);
                }
                else
                {
                    modeBtn1.SetActive(false);
                    modeBtn2.SetActive(true);
                }
            }
            else
            {
                modeBtn1.SetActive(false);
                modeBtn2.SetActive(false);
            }
        }
        else
        {
            modeBtn1.SetActive(false);
            modeBtn2.SetActive(false);
            mtPanel.SetActive(true);
            atPanel.SetActive(false);
//          medbtnLeft.SetActive(false);
//          medbtnRight.SetActive(true);
        }

        //深渊舔怪不需要显示血瓶..
        if (sdUICharacter.Instance.GetBattleType() == (byte)HeaderProto.LEVEL_BATTLE_TYPE.LEVEL_BATTLE_TYPE_ABYSS)
        {
//          medbtnLeft.SetActive(false);
//          medbtnRight.SetActive(false);
        }
    }
示例#16
0
    public void Start()
    {
        sdUICharacter.Instance.HideFightUi();
        sdUICharacter.Instance.selectTreasure = 0;
        fightTime = sdUICharacter.Instance.fightTime;
        if (moneyObj != null)
        {
            moneyObj.GetComponent <UILabel>().text = "0";
        }

        if (expPanel != null)
        {
            expPanel.SetActive(false);
        }

        if (moneyPanel != null)
        {
            moneyPanel.SetActive(false);
        }

        if (itemPanel != null)
        {
            itemPanel.SetActive(false);
        }

        sdGameLevel level = GameObject.Find("@GameLevel").GetComponent <sdGameLevel>();

        if (level != null)
        {
            level.FullAutoMode = false;
        }

        if (btn_CloseLvPanel != null)
        {
            btn_CloseLvPanel.onClick.Add(new EventDelegate(OnLvPanelClose));
        }

        sdUICharacter.Instance.HideFightUi();

        //深渊BOSS结算,只需要显示评级那个界面..
        if (sdUICharacter.Instance.GetBattleType() == (byte)HeaderProto.LEVEL_BATTLE_TYPE.LEVEL_BATTLE_TYPE_ABYSS)
        {
            isMoveStop        = false;
            isTimeEffectStop  = true;
            isTimeStop        = true;
            isMoneyEffectStop = true;
            moneyStop         = true;
            lvMax             = true;
            expStop           = true;
            bLvup             = false;
            itemShowTime      = 0;
            itemStop          = true;
            bStep1            = true;
            isMoveStop        = true;

            scorePanel.GetComponent <sdAnchor>().enabled = false;
            scorePanel.GetComponent <UIAnchor>().enabled = false;

            scorePanel.transform.localPosition = new Vector3(810.0f, 216.0f, 0.0f);
            firstPanel.transform.localPosition = new Vector3(-1350.0f, 0.0f, 0.0f);
            secPanel.transform.localPosition   = new Vector3(0.0f, -240.0f, 0.0f);
        }
        else
        {
            moneyStop = false;
            expStop   = false;
            itemStop  = false;
        }

        curIndex = 0;
//      if (lvUp != null)
//      {
//          lvUp.SetActive(false);
//      }
        lvMax = false;

        if (timeObj != null)
        {
            timeObj.GetComponent <UILabel>().text = "";
        }

        if (getEffect != null)
        {
            getEffect.SetActive(false);
        }
    }
示例#17
0
    public void loadUIObj(ResLoadParams param, UnityEngine.Object obj)
    {
        if (param.info == "arrow")
        {
            if (arrowUI == null)
            {
                arrowUI = GameObject.Instantiate(obj) as GameObject;

                /*if(uiPanel != null)
                 * {
                 *      arrowUI.transform.parent = uiPanel.transform;
                 *
                 *      arrowUI.transform.localPosition = Vector3.zero;
                 *      arrowUI.transform.localRotation = Quaternion.identity;
                 *      arrowUI.transform.localScale = new Vector3(1.0f,1.0f,1.0f);
                 * }*/

                sonArrowUI = arrowUI.transform.FindChild("sonArrow").gameObject;

                arrowUI.SetActive(false);
            }
        }
        else if (param.info == "fight")
        {
            if (sdUICharacter.Instance.GetFightUi() == null)
            {
                GameObject fightUI = GameObject.Instantiate(obj) as GameObject;

                sdUICharacter.Instance.SetFightUi(fightUI);
                fightUI.name = "FightUi";

                Vector3    localPos   = fightUI.transform.localPosition;
                Quaternion localRot   = fightUI.transform.localRotation;
                Vector3    localScale = fightUI.transform.localScale;

                if (uiPanel != null)
                {
                    fightUI.transform.parent = uiPanel.transform;

                    fightUI.transform.localPosition = localPos;
                    fightUI.transform.localRotation = localRot;
                    fightUI.transform.localScale    = localScale;
                }


                GameObject kHeadShow = GameObject.Find("HeadShow");                     //< 头像显示aa
                if (kHeadShow != null)
                {
                    UIAtlas     kAtlas       = null;
                    string      kAtlasSprite = null;
                    sdGameLevel kGameLevel   = sdGameLevel.instance;
                    if (kGameLevel != null)
                    {
                        kAtlas       = kGameLevel.AvatarHeadAtlas;
                        kAtlasSprite = kGameLevel.AvatarHeadSprite;
                    }

                    UISprite kUISprite = kHeadShow.GetComponent <UISprite>();
                    if (kUISprite)
                    {
                        kUISprite.atlas      = kAtlas;
                        kUISprite.spriteName = kAtlasSprite;
                    }
                }
                //bool bHide = sdConfDataMgr.Instance().ShowMovie(sdUICharacter.Instance.iCurrentLevelID);
                if (!bFightInitVisible)
                {
                    sdUICharacter.Instance.HideFightUi();
                    bFightInitVisible = true;
                }
            }
        }
        else if (param.info == "jiesuan")
        {
            if (JiesuanButton == null)
            {
                JiesuanButton = GameObject.Instantiate(obj) as GameObject;

                JiesuanButton.name = "JieSuanButon";

                Vector3    localPos   = JiesuanButton.transform.localPosition;
                Quaternion localRot   = JiesuanButton.transform.localRotation;
                Vector3    localScale = JiesuanButton.transform.localScale;

                if (uiPanel != null)
                {
                    JiesuanButton.transform.parent = uiPanel.transform;

                    JiesuanButton.transform.localPosition = localPos;
                    JiesuanButton.transform.localRotation = localRot;
                    JiesuanButton.transform.localScale    = localScale;
                }

                JiesuanButton.SetActive(false);
            }
        }
    }