mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-04-16 05:46:10 -05:00
- Modified LobbyPlayerState to hold roles - Set players to runners on lobby join - Add button to swap teams - Setup ServerRPC to handle team swap - Modified logic to make sure all roles filled before game start
25 lines
660 B
C#
25 lines
660 B
C#
using MLAPI.Serialization;
|
|
|
|
public struct LobbyPlayerState : INetworkSerializable {
|
|
public ulong ClientId;
|
|
public string PlayerName;
|
|
public bool IsReady;
|
|
public bool IsKing;
|
|
|
|
public LobbyPlayerState(ulong clientId, string playerName, bool isReady, bool isKing)
|
|
{
|
|
ClientId = clientId;
|
|
PlayerName = playerName;
|
|
IsReady = isReady;
|
|
IsKing = isKing;
|
|
}
|
|
|
|
public void NetworkSerialize(NetworkSerializer serializer)
|
|
{
|
|
serializer.Serialize(ref ClientId);
|
|
serializer.Serialize(ref PlayerName);
|
|
serializer.Serialize(ref IsReady);
|
|
serializer.Serialize(ref IsKing);
|
|
}
|
|
}
|