PlayerUI
prefabs with SyncVars and EventsCanvasUI
script with references to its children:PlayerUI
prefab is a UI fragment that has a PlayerUI
script with references to its own children:PlayerUI
prefab and three SyncVars
:PlayerUI
is instantiated as a child of the PlayersPanel
in the Canvas via the references provided in the CanvasUI
script, and the SetPlayer
method is called with the corresponding Player script reference. The PlayerUI
script subscribes to the events above, and updates its UI elements as the SyncVars
are updated from the server.