Exemple #1
0
        private void OnLoadFinish()
        {
            if (WorldSystem.Instance.IsObserver)
            {
                UserInfo myself = WorldSystem.Instance.CreatePlayerSelf(0x0ffffffe, 1);
                if (null != myself)//观战客户端创建一个虚拟玩家(不关联view,血量不要为0,主要目的是为了适应客户端代码里对主角的判断)
                {
                    myself.SetLevel(16);
                    myself.SetHp(Operate_Type.OT_Absolute, 999999);
                }
                NotifyUserEnter();
            }

            if (WorldSystem.Instance.IsObserver)
            {
                DashFireMessage.Msg_CR_Observer build = new DashFireMessage.Msg_CR_Observer();
                NetworkSystem.Instance.SendMessage(build);
                LogSystem.Debug("send Msg_CR_Observer to roomserver");
            }
            else if (WorldSystem.Instance.IsPveScene())
            {
                //单机游戏逻辑启动
                WorldSystem.Instance.StartGame();
                NotifyUserEnter();
            }
            else
            {
                DashFireMessage.Msg_CRC_Create build = new DashFireMessage.Msg_CRC_Create();
                NetworkSystem.Instance.SendMessage(build);
                LogSystem.Debug("send Msg_CRC_Create to roomserver");
            }
            GfxSystem.GfxLog("SceneResource.OnLoadFinish");
            m_IsWaitSceneLoad = false;

            GfxSystem.PublishGfxEvent("ge_loading_finish", "ui");
        }