Scoreboard UI

Scripts

Size: 1.08 KB

You need to login to download this file.

  1. Create a scoreboard canvas. This can be a background image with a text field on top.
  2. Add the "ScoreBoard.cs" script from the download link above to a empty gameobject (like a GameManager).
  3. Drag the canvas into the canvas field and the text element into the "killCounterText" field.
  4. Add the following code to the script where the character takes damage (to add damage points) or dies (to add kills). This also works when picking up coins, etc.:
Scoreboard.instance.AddKill();

Scoreboard is the script that manages the UI, and AddKill() is the function that increments the kill counter.

recommended