Unity Space Shooter – Chapter 14 – Score Inside and Outside

Inside

You’ve seen it before.  Add these publics to the the GameController.

Then Add the components on the screen, then drag and drop.

Include UpdateScore() in the Start routine.

Outside

Make a public addscore routine in game controller

In any routine that needs to add a score, get a reference to the GameController, then at the right time, call the new routine. ( the AddScore() routines above doesnt match below, but  you get the picture.)