quantum-space-buddies/QSB/PlayerSyncObject.cs

13 lines
407 B
C#
Raw Normal View History

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