Beispiel #1
0
 public void resetReward()
 {
     Debug.Log("resetReward");
     this.rewardComplete                   = null;
     this.rewardAd.OnAdClosed             -= this.onCloseReward;
     this.rewardAd.OnAdRewarded           -= this.onCompleteReward;
     this.rewardAd.OnAdLeavingApplication -= this.onClickReward;
     this.reward = null;
     this.loadReward();
 }
Beispiel #2
0
 public void showReward(RewardCallback onComplete)
 {
     if (!this.isRewardLoaded())
     {
         if (onComplete != null)
         {
             onComplete(0);
         }
         return;
     }
     Debug.Log("showReward");
     this.sendAppEvent("ca_ad_rv_initiated");
     this.sendAppEvent("ca_ad_rv_impression");
     this.rewardComplete                   = onComplete;
     this.rewardAd.OnAdClosed             += this.onCloseReward;
     this.rewardAd.OnAdRewarded           += this.onCompleteReward;
     this.rewardAd.OnAdLeavingApplication += this.onClickReward;
     this.rewardAd.Show();
     this.reward = null;
 }
 /// <summary>
 /// Sets a reward handler for any API call results that return rewards.
 /// </summary>
 /// <param name="cb">The reward callback handler.</param>
 /// <see cref="http://getbraincloud.com/apidocs">The brainCloud API docs site for more information on the return JSON</see>
 public void RegisterRewardCallback(RewardCallback cb)
 {
     _comms.RegisterRewardCallback(cb);
 }
 /// <summary>
 /// Sets a reward handler for any api call results that return rewards.
 /// </summary>
 /// <param name="in_cb">The reward callback handler.</param>
 /// <see cref="http://getbraincloud.com/apidocs">The brainCloud apidocs site for more information on the return JSON</see>
 public void RegisterRewardCallback(RewardCallback in_cb)
 {
     m_bc.RegisterRewardCallback(in_cb);
 }
Beispiel #5
0
 public static void ShowReward(RewardCallback onComplete = null)
 {
     Instance.showReward(onComplete);
 }
Beispiel #6
0
 public void DeregisterRewardCallback()
 {
     m_rewardCallback = null;
 }
Beispiel #7
0
 public void RegisterRewardCallback(RewardCallback in_cb)
 {
     m_rewardCallback = in_cb;
 }