Updating lives UI in Unity

Jaime
Oct 31, 2021

At this point, we need to add Player lives in the game:

We will control the UI update via a delegate. In this case it’s UpdateLives:

On the UIManager, we simply listen to UpdateLives executed in the Player class to call Display Lives function:

Finally, you need a reference to the Lives_Text object in the UI Manager:

When the game is played. The Lives text UI is updated.

--

--