Admob ads static script

Is it a better idea to use a static script for loading admob ads instead of loading at the start of every scene? For me it seems that ads don’t have time to load a lot of the time but I haven’t seen anyone using that way.
I currently use 1 Ad Manager gameobject for every scene with the script attached.

Thank you for your feedback

Admob belongs to Google.
Good idea using “public static class AdMobAndroid”…

1 Like

What do you mean? Are you saying I should use public static class and not Monobehaviour?

Sure!

AdMobAndroid.createBanner();

public static class AdMobAndroid
{
    // ===========================================================================
    //                                 AdMobAndroid
    // ===========================================================================

    static AdMobAndroid()
    {
        if( Application.platform != RuntimePlatform.Android ) { return; }
    }

    // ===========================================================================
    //                                 BannerAd
    // ===========================================================================

    public static void createBanner()
    { ... }
}
1 Like

May I know for what reason/reasons you prefer this over Monobehaviour setup?
I got some logcatting done and seems that something of Exoplayer is making an error possibly causing my ads to stop showing up. Lots and lots of problems sigh

May I know for what reason/reasons you prefer this over Monobehaviour setup?

You can use it in the whole code, everywhere…