quantum-space-buddies/QSB/Utility/UnetExtensions.cs
Mister_Nebula 8a5600aa6a fix stuff
2020-12-02 21:21:43 +00:00

18 lines
429 B
C#

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