1. Set Video Ads Callback
Yodo1U3dAdsSDK.setRewardVideoDelegate((Yodo1U3dAdsConstants.AdEvent adEvent, string error) => { Debug.Log("[Yodo1 Ads] RewardVideoDelegate:" + adEvent + "\n" + error); switch (adEvent) { case Yodo1U3dAdsConstants.AdEvent.AdEventClick: Debug.Log("[Yodo1 Ads] Reward video advertising has been clicked."); break; case Yodo1U3dAdsConstants.AdEvent.AdEventClose: Debug.Log("[Yodo1 Ads] Reward video advertising has been closed."); break; case Yodo1U3dAdsConstants.AdEvent.AdEventShowSuccess: Debug.Log("[Yodo1 Ads] Reward video advertising has shown successful."); break; case Yodo1U3dAdsConstants.AdEvent.AdEventShowFail: Debug.Log("[Yodo1 Ads] Reward video advertising show failed, the error message:" + error); break; case Yodo1U3dAdsConstants.AdEvent.AdEventFinish: Debug.Log("[Yodo1 Ads] Reward video advertising has been played finish, give rewards to the player."); break; } });
2. Check Video Loading Status
bool isReady = Yodo1U3dAds.VideoIsReady();
3. Show Video Ads
Yodo1U3dAds.ShowVideo();
4. Code Implementation
Below is an example of the implementation of banners from our sample project. You can find the new project here.
First, this function is triggered when a Rewarded Video should show in the UI.
Note: ConsoleText.text is optional and can be commented out. need just comment this line.
Second, the RewaredVideoEvents() function is triggered. This sets in motion the callbacks for the Rewarded Video ads, which track what happens when the ad is filled, including the user interaction and whether or not the ad is shown successfully.
Comments
0 comments
Article is closed for comments.