quantum-space-buddies/QSB/PlayerSyncObject.cs
2020-09-04 20:09:25 +01:00

14 lines
413 B
C#

using System;
using UnityEngine.Networking;
namespace QSB
{
public abstract class PlayerSyncObject : NetworkBehaviour
{
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);
}
}