quantum-space-buddies/QSB/PlayerSyncObject.cs
AmazingAlek 321c7db7f7
random fixes (#200)
* 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>
2020-08-23 21:01:09 +02:00

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);
}
}