本文整理汇总了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();
}
示例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();
}
}
}
示例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;
}
示例4: Decode
public void Decode(NetIncomingMessage im)
{
this.Id = im.ReadInt32();
this.MessageTime = im.ReadDouble();
this.Health = im.ReadFloat();
this.MaxHealth = im.ReadFloat();
}
示例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);
}
示例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();
}
示例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());
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}
示例12: ReadVector3
public static Vector3 ReadVector3(NetIncomingMessage msg)
{
Vector3 data;
data.x = msg.ReadFloat();
data.y = msg.ReadFloat();
data.z = msg.ReadFloat();
return data;
}
示例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;
}
示例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);
}
示例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);
}