mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-04 03:39:55 +00:00
dc6232bbcf
* A lot of cleanup - tried to do it safely. * Didn't invert ifs, as that'll ruin the diff. * Haven't deleted any unused code or renamed any methods/variables.
37 lines
882 B
C#
37 lines
882 B
C#
using QuantumUNET.Components;
|
|
using UnityEngine;
|
|
|
|
namespace QuantumUNET
|
|
{
|
|
public class QSBPlayerController
|
|
{
|
|
public short PlayerControllerId = -1;
|
|
public QSBNetworkIdentity UnetView;
|
|
public GameObject Gameobject;
|
|
public const int MaxPlayersPerClient = 32;
|
|
public bool IsValid => PlayerControllerId != -1;
|
|
|
|
internal const short kMaxLocalPlayers = 8;
|
|
|
|
public QSBPlayerController()
|
|
{
|
|
}
|
|
|
|
internal QSBPlayerController(GameObject go, short playerControllerId)
|
|
{
|
|
Gameobject = go;
|
|
UnetView = go.GetComponent<QSBNetworkIdentity>();
|
|
PlayerControllerId = playerControllerId;
|
|
}
|
|
|
|
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
|
|
});
|
|
}
|
|
}
|
|
} |