public void SetInterstitialAdsListner() { Yodo1U3dSDK.setInterstitialAdDelegate((Yodo1U3dConstants.AdEvent adEvent, string error) => { Debug.Log("InterstitialAdDelegate:" + adEvent + "\n" + error); switch (adEvent) { case Yodo1U3dConstants.AdEvent.AdEventClick: AnalyticsEvent.AdStart(false); Debug.Log("Interstital ad has been clicked."); break; case Yodo1U3dConstants.AdEvent.AdEventClose: //LevelLoader.LoadClickedMap(targetLevel); Debug.Log("Interstital ad has been closed."); break; case Yodo1U3dConstants.AdEvent.AdEventShowSuccess: //LevelLoader.LoadClickedMap(targetLevel); AnalyticsEvent.AdComplete(false); break; case Yodo1U3dConstants.AdEvent.AdEventShowFail: Debug.Log("Interstital ad has been show failed, the error message:" + error); break; } }); }
public void SetRewaredAdsListner() { Yodo1U3dSDK.setRewardVideoDelegate((Yodo1U3dConstants.AdEvent adEvent, string error) => { Debug.Log("RewardVideoDelegate:" + adEvent + "\n" + error); switch (adEvent) { case Yodo1U3dConstants.AdEvent.AdEventClick: AnalyticsEvent.AdStart(true); Debug.Log("Rewarded video ad has been clicked."); break; case Yodo1U3dConstants.AdEvent.AdEventClose: Debug.Log("Rewarded video ad has been closed."); break; case Yodo1U3dConstants.AdEvent.AdEventShowSuccess: AnalyticsEvent.AdComplete(true); OnRewaredVideoSuccess(); Debug.Log("Rewarded video ad has shown successful."); break; case Yodo1U3dConstants.AdEvent.AdEventShowFail: Debug.Log("Rewarded video ad show failed, the error message:" + error); break; case Yodo1U3dConstants.AdEvent.AdEventFinish: Debug.Log("Rewarded video ad has been played finish, give rewards to the player."); break; } // if (rewardType == AD_REWARD_TYPE.GET_REWARD_ITEM) // { // rewardEffectBackground.SetActive(false); // } }); }
void Start() { isTimes = true; Yodo1U3dAds.SetUserConsent(true); Yodo1U3dAds.SetTagForUnderAgeOfConsent(false); Yodo1U3dAds.SetLogEnable(true); Yodo1U3dAds.InitializeSdk(); Yodo1U3dSDK.setBannerdDelegate((Yodo1U3dConstants.AdEvent adEvent, string error) => { Debug.Log("[Yodo1 Ads] BannerdDelegate:" + adEvent + "\n" + error); switch (adEvent) { case Yodo1U3dConstants.AdEvent.AdEventClick: Debug.Log("[Yodo1 Ads] Banner advertising has been clicked."); break; case Yodo1U3dConstants.AdEvent.AdEventClose: Debug.Log("[Yodo1 Ads] Banner advertising has been closed."); break; case Yodo1U3dConstants.AdEvent.AdEventShowSuccess: Debug.Log("[Yodo1 Ads] Banner advertising has been shown."); break; case Yodo1U3dConstants.AdEvent.AdEventShowFail: Debug.Log("[Yodo1 Ads] Banner advertising show failed, the error message:" + error); break; } }); Yodo1U3dSDK.setInterstitialAdDelegate((Yodo1U3dConstants.AdEvent adEvent, string error) => { Debug.Log("[Yodo1 Ads] InterstitialAdDelegate:" + adEvent + "\n" + error); switch (adEvent) { case Yodo1U3dConstants.AdEvent.AdEventClick: Debug.Log("[Yodo1 Ads] Interstital advertising has been clicked."); break; case Yodo1U3dConstants.AdEvent.AdEventClose: Debug.Log("[Yodo1 Ads] Interstital advertising has been closed."); break; case Yodo1U3dConstants.AdEvent.AdEventShowSuccess: Debug.Log("[Yodo1 Ads] Interstital advertising has been shown."); break; case Yodo1U3dConstants.AdEvent.AdEventShowFail: Debug.Log("[Yodo1 Ads] Interstital advertising show failed, the error message:" + error); break; } }); Yodo1U3dSDK.setRewardVideoDelegate((Yodo1U3dConstants.AdEvent adEvent, string error) => { Debug.Log("[Yodo1 Ads] RewardVideoDelegate:" + adEvent + "\n" + error); switch (adEvent) { case Yodo1U3dConstants.AdEvent.AdEventClick: Debug.Log("[Yodo1 Ads] Reward video advertising has been clicked."); break; case Yodo1U3dConstants.AdEvent.AdEventClose: Debug.Log("[Yodo1 Ads] Reward video advertising has been closed."); break; case Yodo1U3dConstants.AdEvent.AdEventShowSuccess: Debug.Log("[Yodo1 Ads] Reward video advertising has shown successful."); break; case Yodo1U3dConstants.AdEvent.AdEventShowFail: Debug.Log("[Yodo1 Ads] Reward video advertising show failed, the error message:" + error); break; case Yodo1U3dConstants.AdEvent.AdEventFinish: Debug.Log("[Yodo1 Ads] Reward video advertising has been played finish, give rewards to the player."); break; } }); }