Giving the player a reward after an ad

Daniel Kirwan
2 min readSep 29, 2021

Objective: Give the player a reward after watching an ad

In my previous article I wrote about how to show an ad in Unity using Unity ads. Now we get to reward the player after they have watched the ad.

I have a GameManager class that at the moment is controlling whether the player has the key to exit the level and now a reference to the player so that I can reward them after watching an ad.

Doing it this way means the the AdsManager script doesn’t need to have a reference to the player but can call the instance that is referenced in the GameManager class.

When I know that the player has watched the ad I can them call the method to award the gems inside the player (this is where I update the player diamond count).

The GameManager line updates the player with a new diamond count and the UIManager Line reopens the shop with the new diamond count for the shop UI.

--

--