BomberUnits
...a Unity learning project
LobbyPanelController Class Reference

This provides a number of PlayerSlots displaying each in the UI. More...

+ Inheritance diagram for LobbyPanelController:
+ Collaboration diagram for LobbyPanelController:

Public Member Functions

void Awake ()
 
void Start ()
 
void OnDestroy ()
 
void OnClickAddPlayer ()
 Callback for the "Add Player" symbol button of the lobby panel. More...
 

Public Attributes

Button addPlayerButton = null
 
GameObject playerSlotPrefab = null
 
GameObject playerSlotParentLayout = null
 
GameObject customizationDialogPrefab = null
 

Private Member Functions

void OnPlayerChange (Player p, EventCause cause)
 Called when a local or remote Player is changed. More...
 
void OnPressRemovePlayerBtn (LocalPlayer p)
 
void OnPressCustomizePlayerFigure (LocalPlayer p)
 
void AddPlayerSlot (Player p)
 Creates a new Slot, shows it and places a reference to it in the Player's instance.
 
void UpdateAddPlayerBtnVisibility ()
 

Private Attributes

GameObject customizationDialogInstance = null
 

Detailed Description

This provides a number of PlayerSlots displaying each in the UI.

When the total number of players is below the maximum number, a vacant slot will be shown which will open a dialogue for adding another player when clicked.

Definition at line 15 of file LobbyPanelController.cs.

Member Function Documentation

◆ OnClickAddPlayer()

void OnClickAddPlayer ( )
inline

Callback for the "Add Player" symbol button of the lobby panel.

The strategy for adding new players is now:

  1. Check whether another player can be added.
  2. Create a player object
  3. Allow for customization
  4. Raise an event to have the new player added. Remark: The player management is responsible to mark the input scheme and color as used upon add. The whole process of player creation is thus kept within this controller and the dialog until ready.

Definition at line 71 of file LobbyPanelController.cs.

◆ OnPlayerChange()

void OnPlayerChange ( Player  p,
EventCause  cause 
)
inlineprivate

Called when a local or remote Player is changed.

Also called for updates of local-only player data (input) to trigger this. In this case, the net content will not have changed.

Definition at line 90 of file LobbyPanelController.cs.


The documentation for this class was generated from the following file: