示例#1
0
    /// <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();
        }
    }
示例#2
0
    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 + "进入场景完成");
        }
    }