Road TO Dev — Communicating with UI in Unity
Ok now that we have the logic setup for what we want to communicate to the UI and know we can change it we need to make it happen. First in our UI Manager lets create a method for the player to communicate with and lets have it require the new information.
Now let’s create the communication on our player. First we need to tell the player what the UIManager.
Don’t forget to null check
Now just add the new communication where we tally up the score putting the score in the required field.
If everything is setup correctly our score text should update on the UI as we kill enemies.