Esempio n. 1
0
    void LoadRV()
    {
#if UNITY_ANDROID
        string slotId = "58f99962affeaa4201970fa6";
#elif UNITY_IOS || UNITY_IPHONE
        string slotId = "61de726d65a17f71c7896827";
#else
        return;
#endif

        if (rewardedVideoAd != null)
        {
            rewardedVideoAd.Destroy();
            rewardedVideoAd = null;
        }

        rewardedVideoAd = new RewardedVideoAd(slotId);
        rewardedVideoAd.OnRewardedVideoLoaded       += RewardedVideoAd_OnRewardedVideoLoaded;
        rewardedVideoAd.OnRewardedVideoFailedToLoad += RewardedVideoAd_OnRewardedVideoFailedToLoad;
        rewardedVideoAd.OnRewardedVideoClicked      += RewardedVideoAd_OnRewardedVideoClicked;
        rewardedVideoAd.OnRewardedVideoStarted      += RewardedVideoAd_OnRewardedVideoStarted;
        rewardedVideoAd.OnRewardedVideoFinished     += RewardedVideoAd_OnRewardedVideoFinished;

        rewardedVideoAd.Load();
    }