![]() |
BomberUnits
...a Unity learning project
|
: Player Management is WIP for Multiplayer
: Write player management
consists of the LocalPlayer and RemotePlayer lists, the player::PlayerManager and the player::NetData structure, which wraps all player information synced across clients.
The PlayerManager listens to many events of the NetManager for syncing player information. Most importantly each player's NetData is stored as a property of the current room, which invokes events whenever that shared data changes.
The PlayerManager in turn raises an event informing on the addition, deletion or change of a player. This is typically bound by the menu UI to update player display and validity of the current player set for launching a match.
References to the player instances are used in many places, e.g. for getting their specific settings. An instance can be queried using a static Get() function on the Player class, handing the player and client IDs.
The player management interface to all the other classes is in need of a clean-up, as this is a bit complicated overall.
The player management shall wrap all tasks related to tracking which players (local and remote) are connected to the game and provide services to them.
The architecture describes the SW components and allocation of responsibilities between them. A player is a physical user's representation in the game, where that user may be part of the host's players or a connected client's players.
The Player class wraps all information on a participating player.
Should allocated functionality differ regarding the above roles, a split into two subclassed to a common 'Player' base class should be considered.
Based on Req. 4:
This class shall be a subclass of a so-called 'UIDialog', which manages a blocking pop-up in-game or in menus. For this Prefabs are used, not references to existing instances. Also after the dialog has ended, the instance is destroyed, not only disabled. The script is therefore a component of the dialog.
A specific dialog subclass handles the special content of the pop-up.