Exemple #1
0
    void Start()
    {
        admob     = GetComponent <GoogleAdMobHandler>();
        unityads  = GetComponent <UnityAdsHandler>();
        applovins = GetComponent <ApplovinHandler>();

        AdsRewardButton.onClick.AddListener(() =>
        {
            unityads.ShowRewarded();
        });
        AdsInsertButton.onClick.AddListener(() =>
        {
            unityads.ShowInsert();
        });

        ApplovinRewardButton.onClick.AddListener(() =>
        {
            applovins.ShowRewarded();
        });

        ApplovinInsertButton.onClick.AddListener(() =>
        {
            applovins.ShowInsert();
        });

        AdMobInsertButton.onClick.AddListener(() =>
        {
            admob.ShowInsert();
        });

        AdMobRewardButton.onClick.AddListener(() =>
        {
            admob.ShowRewarded();
        });
    }
Exemple #2
0
    public void PlayVideoAD(Action <int> act, List <string> adList)
    {
        switch (adList[videoIndex])
        {
        case adMobString:
            admob.ShowRewarded(act);
            break;

        case unityadsString:
            unityads.ShowRewarded(act);
            break;

        case applovinString:
            applovins.ShowRewarded(act);
            break;

        default:
            break;
        }
    }