As the Dungeon Escape Game is finished, it is ready to add some ads to our game. As we know, rewarding a player with an in-game incentive encourages the player to watch an ad.
Added a new button on the top right corner, that will provide the player 100 diamonds if he/she watches the whole video.
Now, we need to enable Ads within the project. Click on Window — General — Services (Ctrl + 0).
Click on Ads and click on OFF to turn it ON. You will face a warning if you are designing the game especially for the children under the age of 13, for this game, the answer is no.
You will observe that Unity will provide a link for you in order to help you to build your ads.
Welcome to Unity Ads
Unity Ads is a comprehensive monetization platform for Unity, iOS, and Android developers. Use it to easily monetize…
Make sure to check the Enable Test Mode box until your game is finalized. Below, you can find your Game Id’s for Ios and Android.
Click on Dashboard and it will take you to the landing page. Unity allows us to control and analyze the data of our game with great detail. I will be exploring these at a later time. For now, let’s stick with the Ads.
Click On Monetize, and select your project on the Pop-Up screen.
To add ads into our game, click on Placements.
As can be seen on the right side, Unity allows us to use 2 types of ad videos. video, is the default ads that we can skip after viewing for 5 seconds. Whereas rewardedVideos are not skippable. Additionally, we can track if a user has finished a rewardedvideo so that we can give the reward accordingly. In this case, rewardedvideo will be used.
I am actually very surprised to find out how easy it is to integrate ads into our games. On the Dashboard, you will realize links that includes deep explanations on all platforms.
Once you click on the C# one, it will take you to the integration guide (click here). It is so well prepared that all you left is to apply the guide step by step by just changing the game id to your game id’s (do not forget that they are not same for Ios and Android) and inserting the necessary methods for reward mechanisms.
In brief, you need to create an AdsManager script and a AdsButton Script. Just a reminder, do not forget to add the necessary namespaces and IUnityAdsListener interface.
The only thing I needed to do was to call the method that will add the player 100 diamonds if the user finishes the ad: