public static SpeedParams ReadWaypointSpeedParams(this ByteReader reader) { var data = new SpeedParams(); data.PathSpeedOverride = reader.ReadFloat(); data.ParabolicGravity = reader.ReadFloat(); data.ParabolicStartPoint = reader.ReadVector2(); data.Facing = reader.ReadBool(); data.FollowNetID = reader.ReadUInt32(); data.FollowDistance = reader.ReadFloat(); data.FollowBackDistance = reader.ReadFloat(); data.FollowTravelTime = reader.ReadFloat(); return(data); }
public static void WriteWaypointSpeedParams(this ByteWriter writer, SpeedParams data) { if (data == null) { data = new SpeedParams(); } writer.WriteFloat(data.PathSpeedOverride); writer.WriteFloat(data.ParabolicGravity); writer.WriteVector2(data.ParabolicStartPoint); writer.WriteBool(data.Facing); writer.WriteUInt32(data.FollowNetID); writer.WriteFloat(data.FollowDistance); writer.WriteFloat(data.FollowBackDistance); writer.WriteFloat(data.FollowTravelTime); }
public MovementDataWithSpeed(ByteReader reader, int movementSyncID) { this.SyncID = movementSyncID; byte bitfield = reader.ReadByte(); byte size = (byte)(bitfield >> 1); HasTeleportID = (bitfield & 1) != 0; if (size > 0) { TeleportNetID = reader.ReadUInt32(); if (HasTeleportID) { TeleportID = reader.ReadByte(); } SpeedParams = reader.ReadWaypointSpeedParams(); Waypoints = reader.ReadCompressedWaypoints(size); } }