public static void SpawnPlayer(Packet _packet) { Guid _id = _packet.ReadGuid(); string _username = _packet.ReadString(); Vector3 _position = _packet.ReadVector3(); Quaternion _rotation = _packet.ReadQuaternion(); PlayerHandler player = new PlayerHandler(_id, _username); player.rotation = _rotation; player.position = _position; GameManager.Get.AddPlayer(_id, player); }
public static void PlayerTransform(Packet _packet) { Guid _id = _packet.ReadGuid(); Vector3 _position = _packet.ReadVector3(); Quaternion _rotation = _packet.ReadQuaternion(); PlayerHandler player = GameManager.Get.Players[_id]; if (player != GameManager.Get.LocalPlayer) { player.rotation = _rotation; } player.position = _position; }