quantum-space-buddies/QuantumUNET/QSBPlayerController.cs

37 lines
882 B
C#
Raw Normal View History

2020-12-07 21:19:16 +00:00
using QuantumUNET.Components;
using UnityEngine;
2020-12-02 12:42:26 +00:00
2020-12-04 22:14:53 +00:00
namespace QuantumUNET
2020-12-02 12:42:26 +00:00
{
public class QSBPlayerController
{
2020-12-03 11:56:32 +00:00
public short PlayerControllerId = -1;
public QSBNetworkIdentity UnetView;
public GameObject Gameobject;
public const int MaxPlayersPerClient = 32;
public bool IsValid => PlayerControllerId != -1;
2020-12-03 11:56:32 +00:00
internal const short kMaxLocalPlayers = 8;
2020-12-02 12:42:26 +00:00
public QSBPlayerController()
{
}
internal QSBPlayerController(GameObject go, short playerControllerId)
{
2020-12-03 11:56:32 +00:00
Gameobject = go;
UnetView = go.GetComponent<QSBNetworkIdentity>();
PlayerControllerId = playerControllerId;
2020-12-02 12:42:26 +00:00
}
public override string ToString()
{
return string.Format("ID={0} NetworkIdentity NetID={1} Player={2}", new object[]
{
2020-12-03 11:56:32 +00:00
PlayerControllerId,
UnetView == null ? "null" : UnetView.NetId.ToString(),
Gameobject == null ? "null" : Gameobject.name
2020-12-02 12:42:26 +00:00
});
}
}
2020-12-03 08:28:05 +00:00
}