void OnCreateChar(GameEvent e)
        {
            Variant data = e.data;

            debug.Log(data["res"]._int.ToString());
            debug.Log(data.dump());
            if (data["res"]._int == -153)
            {
                flytxt.instance.fly(ContMgr.getCont("a3_createcha_tongming"));
            }
            if (data["res"]._int > 0)
            {
                uint cid = data["cha"]["cid"]._uint;
                PlayerModel.getInstance().cid = cid;
                //  LGPlatInfo.inst.logSDKAP("roleCreate");

                InterfaceMgr.getInstance().close(InterfaceMgr.A3_CREATECHA);
                InterfaceMgr.getInstance().DisposeUI(InterfaceMgr.A3_CREATECHA);

                PlayerModel.getInstance().profession = chooseTab.getSeletedIndex() + 2;
                PlayerModel.getInstance().name       = nameInput.text;

                GameSdkMgr.record_createRole(data["cha"]);

                //当创建角色成功,先不要进入游戏
                //debug.Log("当创建角色成功,先不要进入游戏,进入单机副本");
                SelfRole.s_bStandaloneScene = true;

                //资源会再前面加载,这里必须使用异步加载 map_loading
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.MAP_LOADING);
                //InterfaceMgr.getInstance().ui_async_open("joystick");
                //InterfaceMgr.getInstance().ui_async_open("skillbar");
                InterfaceMgr.getInstance().ui_async_open("a1_gamejoy");
                LGMap lgmap = GRClient.instance.g_gameM.getObject(OBJECT_NAME.LG_MAP) as LGMap;
                lgmap.EnterStandalone();
                MediaClient.instance.StopMusic();
                //MediaClient.instance.clearMusic();

                //if (debug.instance != null)
                //    debug.instance.showMsg(ContMgr.getOutGameCont("debug4"), 3);
            }
        }
Example #2
0
        private void OnCreateChar(GameEvent e)
        {
            Variant data = e.data;

            Debug.Log(data["res"]._int);
            Debug.Log(data.dump());
            bool flag = data["res"]._int == -153;

            if (flag)
            {
                flytxt.instance.fly("已存在同名角色", 0, default(Color), null);
            }
            bool flag2 = data["res"]._int > 0;

            if (flag2)
            {
                uint @uint = data["cha"]["cid"]._uint;
                ModelBase <PlayerModel> .getInstance().cid = @uint;

                InterfaceMgr.getInstance().close(InterfaceMgr.A3_CREATECHA);
                InterfaceMgr.getInstance().destory(InterfaceMgr.A3_CREATECHA);
                ModelBase <PlayerModel> .getInstance().profession = this.chooseTab.getSeletedIndex() + 2;

                ModelBase <PlayerModel> .getInstance().name = this.nameInput.text;

                GameSdkMgr.record_createRole(data["cha"]);
                SelfRole.s_bStandaloneScene = true;
                InterfaceMgr.getInstance().open(InterfaceMgr.MAP_LOADING, null, false);
                InterfaceMgr.getInstance().open("joystick", null, false);
                InterfaceMgr.getInstance().open("skillbar", null, false);
                LGMap lGMap = GRClient.instance.g_gameM.getObject("LG_MAP") as LGMap;
                lGMap.EnterStandalone();
                MediaClient.instance.StopMusic();
                MediaClient.instance.clearMusic();
            }
        }