quantum-space-buddies/QSB/Player/PlayerSyncObject.cs
Mister_Nebula 20312db4ed cleanup
2021-03-09 16:44:14 +00:00

14 lines
503 B
C#

using QuantumUNET;
namespace QSB.Player
{
public abstract class PlayerSyncObject : QNetworkBehaviour
{
public uint AttachedNetId => NetIdentity?.NetId.Value ?? uint.MaxValue;
public uint PlayerId => NetIdentity.RootIdentity?.NetId.Value ?? NetIdentity.NetId.Value;
public PlayerInfo Player => QSBPlayerManager.GetPlayer(PlayerId);
protected virtual void Start() => QSBPlayerManager.AddSyncObject(this);
protected virtual void OnDestroy() => QSBPlayerManager.RemoveSyncObject(this);
}
}