示例#1
0
 void UpdateLocation(byte[] packet)
 {
     if (player != null)
     {
         float x  = BitConverter.ToSingle(packet, 4);
         float y  = BitConverter.ToSingle(packet, 8);
         float z  = BitConverter.ToSingle(packet, 12);
         float rx = BitConverter.ToSingle(packet, 16);
         float ry = BitConverter.ToSingle(packet, 20);
         float rz = BitConverter.ToSingle(packet, 24);
         float rw = BitConverter.ToSingle(packet, 28);
         player.SetLocation(x, y, z);
         player.SetRotation(rz, ry, rz, rw);
         SendUpdateToPlayers();
     }
 }