mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-26 18:35:34 +00:00
321c7db7f7
* usings * fixed wakeup teleport * marker bug * reset ship thing * cache * config order * playerid * nre sector Co-authored-by: Mister_Nebula <41904486+misternebula@users.noreply.github.com>
14 lines
435 B
C#
14 lines
435 B
C#
using UnityEngine.Networking;
|
|
|
|
namespace QSB
|
|
{
|
|
public abstract class PlayerSyncObject : NetworkBehaviour
|
|
{
|
|
protected abstract uint PlayerIdOffset { get; }
|
|
public uint NetId => GetComponent<NetworkIdentity>()?.netId.Value ?? 0;
|
|
public bool IsLocal => hasAuthority;
|
|
public uint PlayerId => NetId - PlayerIdOffset;
|
|
public PlayerInfo Player => PlayerRegistry.GetPlayer(PlayerId);
|
|
}
|
|
}
|