Esempio n. 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();
        });
    }
Esempio n. 2
0
    //播放插页广告
    public void PlayInsertAD(Action <int> act, List <string> adList)
    {
        switch (adList[insertIndex])
        {
        case adMobString:
            admob.ShowInsert(act);
            break;

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

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

        default:
            break;
        }
    }