Example #1
0
 //old method
 public override void DidRewardUser(RewardBasedVideoAd rewardBasedVideoAd, AdReward reward)
 {
     OnRewarded?.Invoke(rewardBasedVideoAd, new MTEventArgs()
     {
         RewardAmount = (int)reward.Amount, RewardType = reward.Type
     });
 }
Example #2
0
        /// @param reward
        ///     The reward to display
        /// @param origin
        ///     The origin position of the particles
        /// @param destination
        ///     The destination of the particles
        ///
        public void Initialise(string currencyID, Vector3 origin, Vector3 destination)
        {
            // Show the reward at the origin position
            m_icon.SafeSprite(GameUtils.GetCurrencySprite(currencyID));
            transform.localScale = Vector3.zero;
            transform.position   = origin;

            var burstTime           = m_burstTime.GetRandomValue() * m_timeScale;
            var moveTime            = burstTime * 0.5f;
            var randomBurstPosition = Vector3.right * m_burstDistance.GetRandomValue() + Vector3.up * m_burstDistance.GetRandomValue();

            // Burst the reward
            m_rewardSequence = DOTween.Sequence();
            m_rewardSequence.Append(transform.DOScale(1.0f, burstTime).SetEase(Ease.OutBack));
            m_rewardSequence.Insert(0.00f, transform.DOBlendableMoveBy(randomBurstPosition, burstTime));
            m_rewardSequence.Insert(0.00f, transform.DOBlendableMoveBy(Vector3.up * Screen.width * 0.05f, moveTime));
            m_rewardSequence.Insert(moveTime, transform.DOBlendableMoveBy(Vector3.down * Screen.width * 0.05f, moveTime));

            // Make the reward fly to its destination
            m_rewardSequence.AppendInterval(m_idleTime.GetRandomValue());
            m_rewardSequence.Append(transform.DOMove(destination, moveTime).SetEase(Ease.InBack));

            // Destroy itself on completion
            m_rewardSequence.AppendCallback(() =>
            {
                OnReachedDestination.SafeInvoke();
                Destroy(gameObject);
            });
            m_rewardSequence.OnComplete(() =>
            {
                OnRewarded.SafeInvoke();
            });
            m_rewardSequence.Play();
        }
Example #3
0
 private void Current_OnRewarded(object sender, MTEventArgs e)
 {
     _isRewarded = true;
     AddRewardeValue();
     CrossMTAdmob.Current.LoadRewardedVideo(_rewardedVideoKey);
     OnRewarded?.Invoke(this, e);
 }
Example #4
0
 private void RewardListener_OnRewardedEvent(object sender, MTEventArgs e)
 {
     OnRewarded?.Invoke(null, e);
 }