My journey becoming a Unity game developer: Phase-44
Objective: Changing the Shields colors to represent the amount of lives the player has.
In the Player script, go to the ShieldsActive() method where we will set up 3 IF conditions using the SWITCH() statement. The parameter we will pass in is the _lives variable representing the amount of lives the player has at the moment. Then use the CASE number to represent each life the player has left and call on the shieldVisualizer game object to get the SpriteRenderer component. Inside the SpriteRenderer, we want to get the Material and access the Color property. Once that’s done, change each color to show each amount of lives remaining which was done as follows: 3 = white, 2 = blue, 1 = red.
I will add some extra features to the shields in the future, but next will be limiting the player to 15 shots.