public override void onAdClicked() { AdiveryEventExecutor.ExecuteInUpdate(() => { ad.OnAdClicked?.Invoke(this, null); }); }
public virtual void onRewardedAdClicked(string placementId) { AdiveryEventExecutor.ExecuteInUpdate(() => { OnRewardedAdClicked?.Invoke(this, placementId); }); }
public override void onError(string reason) { AdiveryEventExecutor.ExecuteInUpdate(() => { ad.OnError?.Invoke(this, reason); }); }
public virtual void onInterstitialAdClosed(string placementId) { AdiveryEventExecutor.ExecuteInUpdate(() => { OnInterstitialAdClosed?.Invoke(this, placementId); }); }
public override void onAdLoaded() { AdiveryEventExecutor.ExecuteInUpdate(() => { ad.RecordImpression(); ad.OnAdLoaded?.Invoke(this, null); }); }
public virtual void onRewardedAdClosed(string placementId, bool isRewarded) { AdiveryEventExecutor.ExecuteInUpdate(() => { AdiveryReward reward = new AdiveryReward(); reward.PlacementId = placementId; reward.IsRewarded = isRewarded; OnRewardedAdClosed?.Invoke(this, reward); }); }
public virtual void onError(string placementId, string reason) { AdiveryEventExecutor.ExecuteInUpdate(() => { AdiveryError error = new AdiveryError(); error.PlacementId = placementId; error.Reason = reason; OnError?.Invoke(this, error); }); }
public static void Configure(string appId) { if (!IsAdiverySupported()) { return; } AdiveryEventExecutor.Initialize(); GetAdiveryClass().CallStatic("configure", GetAndroidApplication(), appId); AddListener(); }
public static void Initialize() { if (IsActive()) { return; } // Add an invisible game object to the scene GameObject obj = new GameObject("AdiveryMainThreadExecuter"); obj.hideFlags = HideFlags.HideAndDontSave; DontDestroyOnLoad(obj); instance = obj.AddComponent <AdiveryEventExecutor>(); }
public void OnDisable() { instance = null; }