/// <summary> /// 进入场景 /// </summary> void OnEnterScene(byte[] p) { ProtoInt proto = ObjectPool.protoPool.GetOrCreate <ProtoInt>(ProtoPool.ProtoRecycleType.Int); if (proto.Parse(p)) { EventLoadSceneArgs loadSceneCfg = new EventLoadSceneArgs(); loadSceneCfg.index = proto.context; loadSceneCfg.progress = null; loadSceneCfg.complete = SendEnterScene; MonoHelper.GetInstance().LoadSceneAsync(loadSceneCfg); proto.Recycle(); } }
void OnMsgEnterScene(TcpHost.SocketAccept socket, byte[] protoData) { ProtoPlayerInfo p; ProtoInt intP = new ProtoInt(); intP.Parse(protoData); int playerMapID = intP.context; intP.Recycle(); if (playerInfos.TryGetValue((byte)socket.id, out p)) { p.mapID = playerMapID; Debug.LogWarning(socket.id + "进入场景完成"); } }