Example #1
0
 public override void onAdClicked()
 {
     AdiveryEventExecutor.ExecuteInUpdate(() =>
     {
         ad.OnAdClicked?.Invoke(this, null);
     });
 }
Example #2
0
 public virtual void onRewardedAdClicked(string placementId)
 {
     AdiveryEventExecutor.ExecuteInUpdate(() =>
     {
         OnRewardedAdClicked?.Invoke(this, placementId);
     });
 }
Example #3
0
 public override void onError(string reason)
 {
     AdiveryEventExecutor.ExecuteInUpdate(() =>
     {
         ad.OnError?.Invoke(this, reason);
     });
 }
Example #4
0
 public virtual void onInterstitialAdClosed(string placementId)
 {
     AdiveryEventExecutor.ExecuteInUpdate(() =>
     {
         OnInterstitialAdClosed?.Invoke(this, placementId);
     });
 }
Example #5
0
 public override void onAdLoaded()
 {
     AdiveryEventExecutor.ExecuteInUpdate(() =>
     {
         ad.RecordImpression();
         ad.OnAdLoaded?.Invoke(this, null);
     });
 }
Example #6
0
 public virtual void onRewardedAdClosed(string placementId, bool isRewarded)
 {
     AdiveryEventExecutor.ExecuteInUpdate(() => {
         AdiveryReward reward = new AdiveryReward();
         reward.PlacementId   = placementId;
         reward.IsRewarded    = isRewarded;
         OnRewardedAdClosed?.Invoke(this, reward);
     });
 }
Example #7
0
 public virtual void onError(string placementId, string reason)
 {
     AdiveryEventExecutor.ExecuteInUpdate(() =>
     {
         AdiveryError error = new AdiveryError();
         error.PlacementId  = placementId;
         error.Reason       = reason;
         OnError?.Invoke(this, error);
     });
 }
Example #8
0
        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;
 }