Exemplo n.º 1
0
    void Start()
    {
        stageClearScript = FindObjectOfType <StageClearScript>();

        string adUnitId;

        adUnitId = "ca-app-pub-3940256099942544/5224354917";


        MobileAds.Initialize(initStatus => {});


        this.rewardedAd = new RewardedAd(adUnitId);

        // Called when an ad request has successfully loaded.
        this.rewardedAd.OnAdLoaded += HandleRewardedAdLoaded;
        // Called when an ad request failed to load.
        this.rewardedAd.OnAdFailedToLoad += HandleRewardedAdFailedToLoad;
        // Called when an ad is shown.
        this.rewardedAd.OnAdOpening += HandleRewardedAdOpening;
        // Called when an ad request failed to show.
        this.rewardedAd.OnAdFailedToShow += HandleRewardedAdFailedToShow;
        // Called when the user should be rewarded for interacting with the ad.
        this.rewardedAd.OnUserEarnedReward += HandleUserEarnedReward;
        // Called when the ad is closed.
        this.rewardedAd.OnAdClosed += HandleRewardedAdClosed;

        loadRewardedVideoAd();
    }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     KillScript       = GameObject.Find("KillText").GetComponent <KillScript>();
     StageClearScript = GameObject.Find("StageClear").GetComponent <StageClearScript>();
 }