Exemple #1
0
    private void enterBtnClicker()
    {
        sceneLoadMsg.Change(2, "03_Fight", () =>
        {
            //Dispatch(AreoCode.UI, UIEvent.PROMPT_PANEL_EVENTCODE, "进入房间成功");

            /*Dispatch(AreoCode.UI, UIEvent.SET_MY_PLAYER_STATE, GameModles.Instance.userDto);
             * Dispatch(AreoCode.UI, UIEvent.PROMPT_PANEL_EVENTCODE, "进入房间成功");*/

            /*int myuid = GameModles.Instance.userDto.ID;
             * GameModles.Instance.matchRoomDto.ResetPosition(myuid);
             * MatchRoomDto RoomDto = GameModles.Instance.matchRoomDto;
             * if (RoomDto.Leftid != -1)
             * {
             *  //如果存在左边玩家
             *  UserDto userDto = RoomDto.UidUdtoDic[RoomDto.Leftid];
             *  Dispatch(AreoCode.UI, UIEvent.SET_LEFT_PLAYER, userDto);
             *  //更新玩家面板
             *  Dispatch(AreoCode.UI, UIEvent.PLAYER_ENTER, userDto.ID);
             * }
             *
             * if(RoomDto.Rightid != -1)
             * {
             *  //如果存在右边玩家
             *  UserDto userDto = RoomDto.UidUdtoDic[RoomDto.Rightid];
             *  Dispatch(AreoCode.UI, UIEvent.SET_RIGHT_PLAYER, userDto);
             *
             *  Dispatch(AreoCode.UI, UIEvent.PLAYER_ENTER, userDto.ID);
             * }*/
        });
        Dispatch(AreoCode.SCENE, SceneCode.LOAD_SCENE, sceneLoadMsg);
    }
Exemple #2
0
 public override void Execute(int eventcode, object message)
 {
     //string str;
     switch (eventcode)
     {
     case SceneCode.LOAD_SCENE:
         //str = message as string;
         //loadMsg.Change(1, "02_Main", SceneManager.sceneLoaded);
         loadMsg = message as SceneLoadMsg;
         loadMsg.Change(loadMsg.Index, loadMsg.Name, loadMsg.LoadAction);
         StartCoroutine(loadScene(loadMsg));
         //MsgCenter.Instance.Dispatch(AreoCode.UI, UIEvent.PROMPT_PANEL_EVENTCODE, "切换场景成功");
         break;
     }
 }
        /// <summary>
        /// 服务器登陆回复
        /// </summary>
        /// <param name="result"></param>
        private void loginResponse(object result)
        {
            string str = result.ToString();

            MsgCenter.Instance.Dispatch(AreoCode.UI, UIEvent.PROMPT_PANEL_EVENTCODE, str);
            if (str == "登陆成功")
            {
                sceneloadMsg.Change(1, "1_Main", () =>
                {
                    //向服务器获取角色信息
                    socketMsg.Change(OpCode.USER, UserCode.GET_USER_CREQ, "0");
                    Dispatch(AreoCode.NET, NetEvent.SENDMSG, socketMsg);
                    Debug.Log("登陆成功,切换场景成功");
                });
                MsgCenter.Instance.Dispatch(AreoCode.SCENE, SceneCode.LOAD_SCENE, sceneloadMsg);
            }
        }