Class LobbyUI
- Namespace
- StarterKit
- Assembly
- StarterKit.dll
STARTERKIT - Lobby UI for multiplayer mode selection. Shows connected players and allows host to start the game. Players can click the map to select their country.
public class LobbyUI : StarterKitPanel
- Inheritance
-
objectLobbyUI
- Inherited Members
Properties
CurrentState
Current lobby state.
public LobbyState CurrentState { get; }
Property Value
SelectedCountryId
The country ID selected by this player in the lobby.
public ushort SelectedCountryId { get; }
Property Value
- ushort
Methods
CreateUI()
Override to create your panel's UI elements. Set panelContainer to your main container element.
protected override void CreateUI()
Initialize(GameState)
public void Initialize(GameState gameStateRef)
Parameters
gameStateRefGameState
OnConnectionEstablished()
Called when connection is established (client only).
public void OnConnectionEstablished()
OnConnectionFailed(string)
Called when connection fails.
public void OnConnectionFailed(string error)
Parameters
errorstring
OnGameStarting()
Called when game is starting.
public void OnGameStarting()
SetNetworkManager(NetworkManager)
Set the network manager reference for country selection sync.
public void SetNetworkManager(NetworkManager manager)
Parameters
managerNetworkManager
SetStatus(string)
Update status text.
public void SetStatus(string status)
Parameters
statusstring
UpdatePlayerList(LobbyPlayerSlot[])
Update the player list display.
public void UpdatePlayerList(LobbyPlayerSlot[] players)
Parameters
playersLobbyPlayerSlot[]
Events
OnCancelled
Fired when cancel is clicked during connection.
public event Action OnCancelled
Event Type
- Action
OnHostSelected
Fired when host is selected. Parameter is port.
public event Action<int> OnHostSelected
Event Type
- Action<int>
OnJoinSelected
Fired when join is selected. Parameters are address and port.
public event Action<string, int> OnJoinSelected
Event Type
- Action<string, int>
OnSinglePlayerSelected
Fired when single player is selected.
public event Action OnSinglePlayerSelected
Event Type
- Action
OnStartGameClicked
Fired when host clicks start game.
public event Action OnStartGameClicked
Event Type
- Action