Esempio n. 1
0
 public override void onAdClicked()
 {
     AdiveryEventExecutor.ExecuteInUpdate(() =>
     {
         ad.OnAdClicked?.Invoke(this, null);
     });
 }
Esempio n. 2
0
 public virtual void onRewardedAdClicked(string placementId)
 {
     AdiveryEventExecutor.ExecuteInUpdate(() =>
     {
         OnRewardedAdClicked?.Invoke(this, placementId);
     });
 }
Esempio n. 3
0
 public override void onError(string reason)
 {
     AdiveryEventExecutor.ExecuteInUpdate(() =>
     {
         ad.OnError?.Invoke(this, reason);
     });
 }
Esempio n. 4
0
 public virtual void onInterstitialAdClosed(string placementId)
 {
     AdiveryEventExecutor.ExecuteInUpdate(() =>
     {
         OnInterstitialAdClosed?.Invoke(this, placementId);
     });
 }
Esempio n. 5
0
 public override void onAdLoaded()
 {
     AdiveryEventExecutor.ExecuteInUpdate(() =>
     {
         ad.RecordImpression();
         ad.OnAdLoaded?.Invoke(this, null);
     });
 }
Esempio n. 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);
     });
 }
Esempio n. 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);
     });
 }
Esempio n. 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;
 }