2020-12-02 12:42:26 +00:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
2020-12-02 21:19:10 +00:00
|
|
|
|
namespace QSB.QuantumUNET
|
2020-12-02 12:42:26 +00:00
|
|
|
|
{
|
|
|
|
|
public class QSBPlayerController
|
|
|
|
|
{
|
|
|
|
|
public QSBPlayerController()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal QSBPlayerController(GameObject go, short playerControllerId)
|
|
|
|
|
{
|
|
|
|
|
gameObject = go;
|
|
|
|
|
unetView = go.GetComponent<QSBNetworkIdentity>();
|
|
|
|
|
this.playerControllerId = playerControllerId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsValid => playerControllerId != -1;
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return string.Format("ID={0} NetworkIdentity NetID={1} Player={2}", new object[]
|
|
|
|
|
{
|
|
|
|
|
playerControllerId,
|
|
|
|
|
(!(unetView != null)) ? "null" : unetView.NetId.ToString(),
|
|
|
|
|
(!(gameObject != null)) ? "null" : gameObject.name
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal const short kMaxLocalPlayers = 8;
|
|
|
|
|
|
|
|
|
|
public short playerControllerId = -1;
|
|
|
|
|
|
|
|
|
|
public QSBNetworkIdentity unetView;
|
|
|
|
|
|
|
|
|
|
public GameObject gameObject;
|
|
|
|
|
|
|
|
|
|
public const int MaxPlayersPerClient = 32;
|
|
|
|
|
}
|
2020-12-03 08:28:05 +00:00
|
|
|
|
}
|