コード例 #1
0
        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);
        }
コード例 #2
0
 public static void WriteSpeedParams(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);
 }
コード例 #3
0
        internal MovementDataWithSpeed(ByteReader reader, int syncID)
        {
            this.SyncID = syncID;
            ushort bitfield = reader.ReadUInt16();

            HasTeleportID = (bitfield & 1) != 0;

            ushort bitfield2 = reader.ReadUInt16();
            byte   size      = (byte)(bitfield2 & 0x7F);

            if (size > 0)
            {
                TeleportNetID = reader.ReadUInt32();
                if (HasTeleportID)
                {
                    TeleportID = reader.ReadByte();
                }
                SpeedParams = reader.ReadWaypointSpeedParams();
                Waypoints   = reader.ReadCompressedWaypoints(size);
            }
        }