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


C# NetIncomingMessage.ReadFloat方法代码示例

本文整理汇总了C#中Lidgren.Network.NetIncomingMessage.ReadFloat方法的典型用法代码示例。如果您正苦于以下问题:C# NetIncomingMessage.ReadFloat方法的具体用法?C# NetIncomingMessage.ReadFloat怎么用?C# NetIncomingMessage.ReadFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Lidgren.Network.NetIncomingMessage的用法示例。


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

示例1: OnDeserialize

 /// <summary>
 /// read the message
 /// </summary>
 /// <param name="message">message to read from</param>
 public void OnDeserialize(NetIncomingMessage message)
 {
     X = message.ReadFloat();
     Y = message.ReadFloat();
     Z = message.ReadFloat();
     W = message.ReadFloat();
 }
开发者ID:traleven,项目名称:PNet,代码行数:11,代码来源:SerializedStructs.cs

示例2: R

 public void R(NetIncomingMessage im)
 {
     Operat          = im.ReadByte();
     UserId          = im.ReadUInt32();
     if (Operat == Add || Operat == Changed)
     {
         Tag         = im.ReadUInt32();
         if (GameMessageHelper.Is_Changed(Tag, GameMessageHelper.POSITION_TAG))
         {
             X       = im.ReadFloat();
             Y       = im.ReadFloat();
         }
         if (GameMessageHelper.Is_Changed(Tag, GameMessageHelper.RADIUS_TAG))
         {
             Radius  = im.ReadInt32();
         }
         if (GameMessageHelper.Is_Changed(Tag, GameMessageHelper.COLOR_TAG))
         {
             Color   = im.ReadUInt32();
         }
         if (GameMessageHelper.Is_Changed(Tag, GameMessageHelper.NAME_TAG))
         {
             Name    = im.ReadString();
         }
     }
 }
开发者ID:xxy1991,项目名称:cozy,代码行数:26,代码来源:Msg_AgarPlayInfo.cs

示例3: ReadLine

        public static Line ReadLine(NetIncomingMessage message, bool isServer=false)
        {
            float removeAnimation = message.ReadFloat();
            Vector2 animationEnd = message.ReadVector2();
            int turn = message.ReadInt32();
            bool wasGrowing = message.ReadBoolean();
            Vector2 begin = message.ReadVector2();
            Vector2 end = message.ReadVector2();
            float thickness = message.ReadFloat();

            if (!isServer) {
                animationEnd = Constants.FromField(animationEnd);
                begin = Constants.FromField(begin);
                end = Constants.FromField(end);
            }

            Line l = new Line (begin, end);
            l.removeAnimationTime = removeAnimation;
            l.animationEnd = animationEnd;
            l.turn = turn;
            l.color = Constants.COLORS[turn];
            l.wasGrowing = wasGrowing;
            l.thickness = thickness;

            return l;
        }
开发者ID:yegorf1,项目名称:Circles,代码行数:26,代码来源:Line.cs

示例4: Decode

 public void Decode(NetIncomingMessage im)
 {
     this.Id = im.ReadInt32();
     this.MessageTime = im.ReadDouble();
     this.Health = im.ReadFloat();
     this.MaxHealth = im.ReadFloat();
 }
开发者ID:Gothen111,项目名称:2DWorld,代码行数:7,代码来源:UpdateObjectHealthMessage.cs

示例5: ToOtherPlayers

        public static void ToOtherPlayers(NetIncomingMessage im, OtherPlayer[] d)
        {
            bool alive = im.ReadBoolean();
            float xp = im.ReadFloat();
            float yp = im.ReadFloat();
            float zp = im.ReadFloat();
            Int32 id = im.ReadInt32();
            float xr = im.ReadFloat();
            float yr = im.ReadFloat();
            Int16 model = im.ReadInt16();
            if (d[id] == null)
            {
                d[id] = new OtherPlayer(xp, yp, zp, id, model, xr, yr);
            }
            d[id].model = model;
            d[id].xr = xr;
            d[id].yr = yr;

            if (!alive)
            {
                d[id].ChangeLifeStatus(false);
            }
            d[id].position = new Vector3(xp, yp, zp);
            d[id].boundingSphere.Center = new Vector3(d[id].position.X, d[id].position.Y + Constants.HEADMAX/2, d[id].position.Z);
        }
开发者ID:andva,项目名称:Eulerian-ShootEmUp,代码行数:25,代码来源:Package.cs

示例6: Read

 protected override void Read(NetIncomingMessage message)
 {
     x = message.ReadFloat();
     y = message.ReadFloat();
     rotation = message.ReadUInt16().FromNetworkRotation() * (180f / (float)Math.PI);
     type = message.ReadByte();
 }
开发者ID:Rohansi,项目名称:Programe,代码行数:7,代码来源:NetAsteroid.cs

示例7: readBytes

 public static void readBytes(NetIncomingMessage data, ref InputObject io)
 {
     data.ReadByte();
     Console.WriteLine(io.HorizontalAxis = data.ReadFloat());
     Console.WriteLine(io.VerticalAxis = data.ReadFloat());
     Console.WriteLine(io.AmingAngle = data.ReadFloat());
     Console.WriteLine(io.Buttons = data.ReadByte());
 }
开发者ID:Harlonlonmo,项目名称:Network-Game,代码行数:8,代码来源:InputParser.cs

示例8: readBytes

 public static void readBytes(NetIncomingMessage data, ClientSprite cs)
 {
     data.ReadByte();
     cs.ID = data.ReadUInt32();
     cs.SpriteID = (SpriteIDs)data.ReadUInt16();
     cs.Position = new Microsoft.Xna.Framework.Vector2(data.ReadFloat(),data.ReadFloat());
     cs.Rotation = data.ReadFloat();
 }
开发者ID:Harlonlonmo,项目名称:Network-Game,代码行数:8,代码来源:ClientSpriteParser.cs

示例9: Read

 protected override void Read(NetIncomingMessage message)
 {
     Name = message.ReadString();
     X = message.ReadFloat();
     Y = message.ReadFloat();
     rotation = message.ReadUInt16().FromNetworkRotation() * (180f / (float)Math.PI);
     Health = message.ReadByte() / (float)byte.MaxValue;
 }
开发者ID:Rohansi,项目名称:Programe,代码行数:8,代码来源:NetShip.cs

示例10: InterpolationPacket

 public InterpolationPacket(NetIncomingMessage message)
 {
     float x = message.ReadFloat();
     float y = message.ReadFloat();
     float z = message.ReadFloat();
     position = new Vector2(x, y);
     rotation = message.ReadFloat();
     time = 0;
 }
开发者ID:millpond,项目名称:space-station-14,代码行数:9,代码来源:InterpolationPacket.cs

示例11: Decode

 public void Decode(NetIncomingMessage im)
 {
     Hour = im.ReadFloat();
     Day = im.ReadFloat();
     Month = im.ReadFloat();
     Year = im.ReadFloat();
     TimeScale = im.ReadFloat();
     Weather = im.ReadInt32();
 }
开发者ID:imGoose,项目名称:SkyrimOnline,代码行数:9,代码来源:WorldEnvironmentStateMessage.cs

示例12: ReadVector3

    public static Vector3 ReadVector3(NetIncomingMessage msg)
    {
        Vector3 data;

        data.x = msg.ReadFloat();
        data.y = msg.ReadFloat();
        data.z = msg.ReadFloat();

        return data;
    }
开发者ID:RainsSoft,项目名称:unity3d-fps-networking-prototype,代码行数:10,代码来源:NetworkUtils.cs

示例13: FromNetBuffer

        public static new Packet FromNetBuffer(NetIncomingMessage incomingMessage)
        {
            // Read values back in
            var velocity = new Vector2(incomingMessage.ReadFloat(), incomingMessage.ReadFloat());
            var location = new Vector2(incomingMessage.ReadFloat(), incomingMessage.ReadFloat());
            var id = incomingMessage.ReadUInt64();

            var packet = new NotifyMovementPacket(velocity, location, id);
            return packet;
        }
开发者ID:hilts-vaughan,项目名称:inspire,代码行数:10,代码来源:NotifyMovementPacket.cs

示例14: Decode

        public override void Decode(NetIncomingMessage msg)
        {
            base.Decode(msg);

            // opt - should probably use ints here
            float x = msg.ReadFloat();
            float y = msg.ReadFloat();
            float z = msg.ReadFloat();
            Position = new Vector3(x, y, z);
        }
开发者ID:jtuttle,项目名称:umbra-client,代码行数:10,代码来源:EntityMoveMessage.cs

示例15: InterpolationPacket

 public InterpolationPacket(NetIncomingMessage message)
 {
     float x = message.ReadFloat();
     float y = message.ReadFloat();
     Position = new Vector2D(x, y);
     Rotation = message.ReadFloat();
     Time = 0;
     Iterations = 0;
     Startposition = new Vector2D(1234, 1234);
 }
开发者ID:Gartley,项目名称:ss13remake,代码行数:10,代码来源:InterpolationPacket.cs


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