TheKingsRace/Assets/Scripts/UI/Lobby/LobbyPlayerState.cs
Julia Butenhoff 0431cb4c4d Added King/Runner Roles and Team Swapping
- 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
2021-10-20 14:08:41 -05:00

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);
}
}