コード例 #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();
        });
    }
コード例 #2
0
 public List <string> asdSortList = new List <string>();//  服务器返回的广告播放排序
 void Start()
 {
     admob     = GetComponent <GoogleAdMobHandler>();
     unityads  = GetComponent <UnityAdsHandler>();
     applovins = GetComponent <ApplovinHandler>();
     asdSortList.Add(adMobString);
     asdSortList.Add(unityadsString);
     asdSortList.Add(applovinString);
 }