コード例 #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();
    }
コード例 #2
0
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();
                RewardedVideo?.Destroy();

                MAdapter           = null !;
                SwipeRefreshLayout = null !;
                MRecycler          = null !;
                EmptyStateLayout   = null !;
                Inflated           = null !;
                IdPost             = null !;
                TypePost           = null !;
                MAdView            = null !;
                RewardedVideo      = null !;
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
コード例 #3
0
        private void DestroyBasic()
        {
            try
            {
                MAdView?.Destroy();
                RewardedVideo?.Destroy();

                MAdapter           = null;
                SwipeRefreshLayout = null;
                MRecycler          = null;
                EmptyStateLayout   = null;
                Inflated           = null;
                IdPost             = null;
                TypePost           = null;
                MAdView            = null;
                RewardedVideo      = null;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }