As mentioned previously, Unity Ads has two different types of ads that we can display: simple and rewarded. Simple ads are easy to use, hence the name, and allow users to have simple full-screen interstitial ads. This can be really useful for moving between levels or perhaps for when the player wants to restart the game. Let's see how we can implement that feature now.
- To get started, it would be a good idea for us to have all of the Ad-related behavior to share a script, so we will create a new class called UnityAdController by going to the Project window, opening the Assets/Scripts folder, and selecting Create | C# Script.
- Open up the file in the IDE of your choice, and use the following code:
using UnityEngine;
#if UNITY_ADS // Can only compile ad code on supported platforms
using UnityEngine.Advertisements; // Advertisement class
#endif
public class...