quantum-space-buddies/QSB/Utility/UnetExtensions.cs
Mister_Nebula 88428ba151 stuff
2020-12-02 08:29:32 +00:00

17 lines
403 B
C#

using QSB.Player;
using QSB.TransformSync;
using UnityEngine.Networking;
namespace QSB.Utility
{
public static class UnetExtensions
{
public static PlayerInfo GetPlayer(this NetworkConnection connection)
{
var go = connection.playerControllers[0].gameObject;
var controller = go.GetComponent<PlayerTransformSync>();
return QSBPlayerManager.GetPlayer(controller.netId.Value);
}
}
}