quantum-space-buddies/QSB/Utility/UnetExtensions.cs

16 lines
394 B
C#
Raw Normal View History

2020-12-02 08:29:32 +00:00
using QSB.Player;
using QSB.TransformSync;
2020-12-04 22:14:53 +00:00
using QuantumUNET;
2020-12-02 08:29:32 +00:00
namespace QSB.Utility
{
public static class UnetExtensions
{
2020-12-02 18:40:38 +00:00
public static PlayerInfo GetPlayer(this QSBNetworkConnection connection)
2020-12-02 08:29:32 +00:00
{
2020-12-03 11:56:32 +00:00
var go = connection.PlayerControllers[0].Gameobject;
2020-12-02 08:29:32 +00:00
var controller = go.GetComponent<PlayerTransformSync>();
2020-12-02 09:51:53 +00:00
return QSBPlayerManager.GetPlayer(controller.NetId.Value);
2020-12-02 08:29:32 +00:00
}
}
2020-12-03 08:28:05 +00:00
}