当前位置: 首页>>代码示例>>C#>>正文


C# NetworkReader类代码示例

本文整理汇总了C#中NetworkReader的典型用法代码示例。如果您正苦于以下问题:C# NetworkReader类的具体用法?C# NetworkReader怎么用?C# NetworkReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NetworkReader类属于命名空间,在下文中一共展示了NetworkReader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Deserialize

 public override void Deserialize(NetworkReader reader)
 {
   this.netId = reader.ReadNetworkId();
   this.payload = reader.ReadBytesAndSize();
   this.teleport = reader.ReadBoolean();
   this.time = (int) reader.ReadPackedUInt32();
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:7,代码来源:OverrideTransformMessage.cs

示例2: Deserialize

 public override void Deserialize(NetworkReader reader)
 {
     proxyId = reader.ReadInt16();
     packet.Compression = (VoiceChatCompression)reader.ReadInt16();
     packet.Length = reader.ReadInt32();
     packet.Data = reader.ReadBytesAndSize();
 }
开发者ID:dgkae,项目名称:unityassets,代码行数:7,代码来源:VoiceChatPacketMessage.cs

示例3: OnDeserialize

 public override void OnDeserialize(NetworkReader reader, bool initialState)
 {
     /*
         Interpolate: pass reader as parameter to fbxobj
     */
     fbxObj.gameObject.transform.position = reader.ReadVector3();
 }
开发者ID:menezesgam,项目名称:poc_vr,代码行数:7,代码来源:RpcManager.cs

示例4: ClientVC

    public ClientVC(NetworkReader nr)
        : base(new Vec2i(0,0), 0)
    {
        this.data = new VesselTile[VesselChunk.DATA_COUNT];

        index.x = nr.ReadInt32();
        index.y = nr.ReadInt32();

        version = nr.ReadUInt32();
        tileCount = nr.ReadInt32();

        for (int i = 0; i < tileCount; i++) {
            //read in vessel tile
            Vec2i tileI;

            tileI.x = nr.ReadInt32();
            tileI.y = nr.ReadInt32();
            FloorType floor0 = (FloorType)nr.ReadByte();
            FloorType floor1 = (FloorType)nr.ReadByte();
            WallTypeMask wallMask = (WallTypeMask)nr.ReadByte();
            bool wallNode = nr.ReadBoolean();

            VesselTile tile = new VesselTile(wallMask, wallNode, floor0, floor1, (uint)VesselTile.FLAGS.NONE);

            SetTile(tileI, tile);
        }
    }
开发者ID:NickPowers43,项目名称:SW,代码行数:27,代码来源:ClientVC.cs

示例5: OnDeserialize

    private CharacterState serverLastState; //SERVER: Store last state

    #endregion Fields

    #region Methods

    /// <summary>
    /// All Clients: Deserialize the state from network
    /// </summary>
    /// <param name="reader"></param>
    /// <param name="initialState"></param>
    public override void OnDeserialize(NetworkReader reader, bool initialState)
    {
        CharacterState state = new CharacterState();

        state.state    = reader.ReadInt32();
        state.position = reader.ReadVector3();
        state.rotation = reader.ReadQuaternion();

        //Client: Received a new state for the local player, treat it as an ACK and do reconciliation
        if (isLocalPlayer) {
            SendMessage("ServerState", state, SendMessageOptions.DontRequireReceiver);
        } else {
            //Other Clients: Received a state, treat it like a new position snapshot from authority
            if (initialState)
            {
                //Others Clients: First state, just snap to new position
                transform.position = state.position;
                transform.rotation = state.rotation;
            }
            else if (networkInterpolation != null)
            {
                //Others Clients: Interpolate between received positions
                networkInterpolation.ReceiveState(state);
            }
        }
    }
开发者ID:atrakeur,项目名称:unity-unet-authoritative-networking,代码行数:37,代码来源:CharacterNetworkSync.cs

示例6: Deserialize

 public override void Deserialize(NetworkReader reader)
 {
     this.netId = reader.ReadNetworkId();
     this.sceneId = reader.ReadSceneId();
     this.position = reader.ReadVector3();
     this.payload = reader.ReadBytesAndSize();
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:7,代码来源:ObjectSpawnSceneMessage.cs

示例7: Deserialize

 public override void Deserialize(NetworkReader reader)
 {
     this.netId = reader.ReadNetworkId();
     this.stateHash = (int) reader.ReadPackedUInt32();
     this.normalizedTime = reader.ReadSingle();
     this.parameters = reader.ReadBytesAndSize();
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:7,代码来源:AnimationMessage.cs

示例8: NetworkClient

 /// <summary>
 /// 
 /// <para>
 /// Creates a new NetworkClient instance.
 /// </para>
 /// 
 /// </summary>
 public NetworkClient()
 {
     if (LogFilter.logDev)
     Debug.Log((object) ("Client created version " + (object) Version.Current));
       this.m_MsgBuffer = new byte[49152];
       this.m_MsgReader = new NetworkReader(this.m_MsgBuffer);
       NetworkClient.AddClient(this);
 }
开发者ID:Kitabalef,项目名称:Unet-Decompiles,代码行数:15,代码来源:NetworkClient.cs

示例9: Deserialize

 public override void Deserialize(NetworkReader reader)
 {
     this.connectionId = (int) reader.ReadPackedUInt32();
     this.address = reader.ReadString();
     this.port = (int) reader.ReadPackedUInt32();
     this.isHost = reader.ReadBoolean();
     this.isYou = reader.ReadBoolean();
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:8,代码来源:PeerInfoMessage.cs

示例10: Deserialize

 public override void Deserialize(NetworkReader reader)
 {
     m_id = reader.ReadNetworkId();
     m_parentId = reader.ReadNetworkId();
     m_childId = reader.ReadInt32();
     m_position = reader.ReadVector3();
     m_payload = reader.ReadBytesAndSize();
 }
开发者ID:bpeake13,项目名称:UnityChildSpawning,代码行数:8,代码来源:ChildSpawnMessage.cs

示例11: Deserialize

 public override void Deserialize(NetworkReader reader)
 {
     ChannelId = reader.ReadString();
     SenderUserId = reader.ReadString();
     SenderUserName = reader.ReadString();
     Message = reader.ReadString();
     Timestamp = JsonWrapper.DeserializeObject<DateTime>(reader.ReadString());
 }
开发者ID:PlayFab,项目名称:PlayFabGameServer,代码行数:8,代码来源:MessageModels.cs

示例12: OnDeserialize

 public override void OnDeserialize(NetworkReader reader, bool initialState)
 {
     if (reader.ReadPackedUInt32() != 0)
     {
         this.m_Slot = reader.ReadByte();
         this.m_ReadyToBegin = reader.ReadBoolean();
     }
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:8,代码来源:NetworkLobbyPlayer.cs

示例13: Deserialize

 public override void Deserialize(NetworkReader reader)
 {
     base.Deserialize(reader);
     int count = reader.ReadInt32();
     Polyline = new List<Vector3>(count);
     for(int i=0; i < count; i++)
         Polyline.Add(reader.ReadVector3());
 }
开发者ID:yuta0023,项目名称:demo,代码行数:8,代码来源:EditorMessages.cs

示例14: Deserialize

 public override void Deserialize(NetworkReader reader)
 {
   this.playerControllerId = (short) reader.ReadUInt16();
   this.msgData = reader.ReadBytesAndSize();
   if (this.msgData == null)
     this.msgSize = 0;
   else
     this.msgSize = this.msgData.Length;
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:9,代码来源:AddPlayerMessage.cs

示例15: NetworkServer

 private NetworkServer()
 {
     NetworkTransport.Init();
       if (LogFilter.logDev)
     Debug.Log((object) ("NetworkServer Created version " + (object) Version.Current));
       this.m_MsgBuffer = new byte[49152];
       this.m_MsgReader = new NetworkReader(this.m_MsgBuffer);
       this.m_RemoveList = new HashSet<NetworkInstanceId>();
 }
开发者ID:Kitabalef,项目名称:Unet-Decompiles,代码行数:9,代码来源:NetworkServer.cs


注:本文中的NetworkReader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。