public void ShowRewarded() { AdEvent rewardedAdCompletedEvent = new AdEvent { Type = AdEventType.REWARDED_AD_COMPLETED, ExtraInfo = 5 }; CentralEventManager.Instance.GetAdsEventManager().AddEvent(rewardedAdCompletedEvent); }
public void ShowInterstitial() { AdEvent interstitialAdCompletedEvent = new AdEvent { Type = AdEventType.INTERSTITIAL_AD_COMPLETED, ExtraInfo = 1 //boxing }; CentralEventManager.Instance.GetAdsEventManager().AddEvent(interstitialAdCompletedEvent); }
protected void RewardShow(Action <AdEvent> status, string placementName, string itemId) { rewardEvent = AdEvent.Show; InterCountTry = 0; rewardPlacementName = placementName; rewardItemId = itemId; onRewardShowSuccess = status; SetStatus(AdType.VideoReward, AdEvent.Show, rewardPlacementName, rewardItemId); PauseApp(true); }
public virtual void RewardOnClose() { #if UNITY_IPHONE if (rewardEvent == AdEvent.Success) { UnityMainThreadDispatcher.Instance().Enqueue(() => { onRewardShowSuccess?.Invoke(AdEvent.Success); onRewardShowSuccess = null; }); } #else //Android --> onRewardShowSuccess onSuccess Event #endif PauseApp(false); rewardEvent = AdEvent.Load; RewardLoad(); }
public virtual void RewardOnShowSuscess(object obj) { if (obj != null) { Debug.Log("ADS RewardOnShowSuscess: " + obj.ToString()); } rewardEvent = AdEvent.Success; SetStatus(AdType.VideoReward, AdEvent.Success, rewardPlacementName, rewardItemId); #if UNITY_ANDROID UnityMainThreadDispatcher.Instance().Enqueue(() => { Debug.Log("ADS RewardOnShowSuscess: " + onRewardShowSuccess.ToString()); onRewardShowSuccess?.Invoke(AdEvent.Success); onRewardShowSuccess = null; }); #else //Iphone --> onRewardShowSuccess onClose Event #endif }
private void OnAdStateChanged(AdType currentType, AdEvent currentEvent, string currentPlacement, string currentItemId) { if (currentEvent == AdEvent.Success) { if (currentType == AdType.Banner) { userData.TotalAdBanner++; } else if (currentType == AdType.Interstitial) { userData.TotalAdInterstitial++; } else if (currentType == AdType.VideoReward) { userData.TotalAdRewarded++; } LogAdsViewed(currentType, currentPlacement, currentItemId); } else if (currentEvent == AdEvent.Show) { AnalyticsManager.LogAdsShow(AdType.VideoReward, currentPlacement, currentItemId); } }