Interstitial Ads on GameOver

Hello! I'm new at coding stuff and I know this is a noob question. I have my game ready but I'm having issues adding my InterstitialAds to show when GameOver.

I have my code working Onclick button as samples provided. But how do I tell my main code to LoadAd on GameOver? I have my game script on one file and all the InterstitialAds in another script file. May I attach both files on the same game object? And if thats the case, how do I call my InterstitialAds script to execute on my main game script? Thanks in advance and sorry for such dump question.

I have followed this tutorial:


But if I add:

public class Game : MonoBehaviour {
private InterstitialAd interstitialAd;

(My InterstitialAd script is called InterstitialAd.cs)

Unity is keep me calling this error:

The type or namespace name 'InterstitialAd' could not be found (are you missing a using directive or an assembly reference?

Why is not reading my script? I have Game.cs and InterstitialAd.cs on same object.

Ideas?

Hello,
Can you please paste the entire scripts of Game.cs and InterstitialAd.cs? So I can investigate further :)

I have fixed just copying from original file, now works, but was the same code :face_with_spiral_eyes:. Still a noob on this stuff, but learning in the process. Just change InterstitialAd.cs to InterstitialAds.cs

public class Game : MonoBehaviour
{
   private InterstitialAds interstitialAds;  
}
void Awake ()
    {
        interstitialAds = GetComponent<InterstitialAds>();
    }
public void GameOver()
    {
        interstitialAds.ShowInterstitial();
   }