mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-10 15:53:19 +00:00
18 lines
429 B
C#
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);
|
|
}
|
|
}
|
|
}
|