quantum-space-buddies/QSB/Utility/UnetExtensions.cs
2020-12-23 12:58:45 +00:00

16 lines
392 B
C#

using QSB.Player;
using QSB.TransformSync;
using QuantumUNET;
namespace QSB.Utility
{
public static class UnetExtensions
{
public static PlayerInfo GetPlayer(this QNetworkConnection connection)
{
var go = connection.PlayerControllers[0].Gameobject;
var controller = go.GetComponent<PlayerTransformSync>();
return QSBPlayerManager.GetPlayer(controller.NetId.Value);
}
}
}