示例#1
0
        void OnPossessPawn(BitStream bs)
        {
            var replicaId = bs.ReadReplicaId();
            var pawnIdx   = bs.ReadByte();

            currentReplicaPossess = replicaId;
            pawnIdxToPossess      = pawnIdx;
        }
示例#2
0
        void OnLoadScene(BitStream bs)
        {
            var sceneName  = bs.ReadString();
            var generation = bs.ReadByte();

            if (currentLoadedSceneGeneration != generation)
            {
                currentLoadedSceneGeneration = generation;

                World.StartCoroutine(LoadScene(sceneName));
            }
        }
示例#3
0
        void OnLoadSceneDone(Connection connection, BitStream bs)
        {
            var generation = bs.ReadByte();

            if (generation != loadSceneGeneration)
            {
                return;
            }

            Debug.Log("[Server] On load scene done: <i>" + connection + "</i> (generation=" + generation + ")");

            ++numLoadScenePlayerAcks;

            //
            var replicaView = server.ReplicaManager.GetReplicaView(connection);

            if (replicaView != null)
            {
                replicaView.IsLoadingLevel = false;
                server.ReplicaManager.ForceReplicaViewRefresh(replicaView);
            }
        }
示例#4
0
 public void Deserialize(BitStream bs)
 {
     Amount = bs.ReadByte();
 }