quantum-space-buddies/QSB/PlayerSyncObject.cs

14 lines
413 B
C#
Raw Normal View History

2020-09-03 16:09:38 +00:00
using System;
using UnityEngine.Networking;
namespace QSB
{
public abstract class PlayerSyncObject : NetworkBehaviour
{
2020-09-04 19:09:25 +00:00
public uint NetId => GetComponent<NetworkIdentity>()?.netId.Value ?? uint.MaxValue;
public uint PlayerId => this.GetPlayerOfObject();
public uint PreviousPlayerId { get; set; }
public PlayerInfo Player => PlayerRegistry.GetPlayer(PlayerId);
}
}