Beispiel #1
0
 public void Show()
 {
     if (state == InterstitialAdState.Ready || debugOverrideShow)
     {
         state = InterstitialAdState.Showing;
         StartCoroutine(DoShow(10f));
     }
     else
     {
         throw new InvalidOperationException("Not Ready");
     }
 }
        private IEnumerator PrepareRequest()
        {
            yield return(new WaitForSeconds(1f));

            hasPendingRequests = false;
            state = InterstitialAdState.Ready;
            Fire(AdCallback.Ready);
            if (playNextReady)
            {
                playNextReady = false;
                Show();
            }
        }
        public void Show()
        {
            if (fireError)
            {
                StartCoroutine(PrepareError());
                return;
            }

            if (state == InterstitialAdState.Ready)
            {
                state = InterstitialAdState.Showing;
                StartCoroutine(DoShow(10f));
            }
            else
            {
                throw new InvalidOperationException("Not Ready. You must request ad first");
            }
        }
        private void Fire(AdCallback cb, object passthrough = null)
        {
            switch (cb)
            {
            case AdCallback.Ready:
                state = InterstitialAdState.Ready;
                if (cbReady != null)
                {
                    cbReady(passthrough);
                }
                break;

            case AdCallback.Completed:
                state = InterstitialAdState.Closed;
                if (cbCompleted != null)
                {
                    cbCompleted(passthrough);
                }

                break;

            case AdCallback.Cancelled:
                state = InterstitialAdState.Closed;
                if (cbCancelled != null)
                {
                    cbCancelled(passthrough);
                }
                break;

            case AdCallback.Error:
                state = InterstitialAdState.Closed;
                if (cbError != null)
                {
                    cbError(passthrough);
                }
                break;
            }
        }
Beispiel #5
0
        void Fire(AdCallback cb)
        {
            switch (cb)
            {
            case AdCallback.Ready:
                state = InterstitialAdState.Ready;
                if (cbReady != null)
                {
                    cbReady(null);
                }
                break;

            case AdCallback.Completed:
                state = InterstitialAdState.Closed;
                if (cbCompleted != null)
                {
                    cbCompleted(null);
                }

                break;

            case AdCallback.Cancelled:
                state = InterstitialAdState.Closed;
                if (cbCancelled != null)
                {
                    cbCancelled(null);
                }
                break;

            case AdCallback.Error:
                state = InterstitialAdState.Closed;
                if (cbError != null)
                {
                    cbError(null);
                }
                break;
            }
        }
 private IEnumerator PrepareRequest()
 {
     yield return new WaitForSeconds(1f);
     hasPendingRequests = false;
     state = InterstitialAdState.Ready;
     Fire(AdCallback.Ready);
     if (playNextReady)
     {
         playNextReady = false;
         Show();
     }
 }
        private void Fire(AdCallback cb, object passthrough = null )
        {
            switch (cb)
            {
                case AdCallback.Ready:
                    state = InterstitialAdState.Ready;
                    if (cbReady != null)
                        cbReady(passthrough);
                    break;
                case AdCallback.Completed:
                    state = InterstitialAdState.Closed;
                    if (cbCompleted != null)
                        cbCompleted(passthrough);

                    break;
                case AdCallback.Cancelled:
                    state = InterstitialAdState.Closed;
                    if (cbCancelled != null)
                        cbCancelled(passthrough);
                    break;
                case AdCallback.Error:
                    state = InterstitialAdState.Closed;
                    if (cbError != null)
                        cbError(passthrough);
                    break;
            }
        }
        public void Show()
        {
            if (fireError)
            {
                StartCoroutine(PrepareError());
                return;
            }

            if (state == InterstitialAdState.Ready )
            {
                state = InterstitialAdState.Showing;
                StartCoroutine(DoShow(10f));
            }
            else
                throw new InvalidOperationException("Not Ready. You must request ad first");
        }
        void Fire(AdCallback cb)
        {
            switch (cb)
            {
                case AdCallback.Ready:
                    state = InterstitialAdState.Ready;
                    if (cbReady != null)
                        cbReady(null);
                    break;
                case AdCallback.Completed:
                    state = InterstitialAdState.Closed;
                    if (cbCompleted != null)
                        cbCompleted(null);

                    break;
                case AdCallback.Cancelled:
                    state = InterstitialAdState.Closed;
                    if (cbCancelled != null)
                        cbCancelled(null);
                    break;
                case AdCallback.Error:
                    state = InterstitialAdState.Closed;
                    if (cbError != null)
                        cbError(null);
                    break;
            }
        }
 public void Show()
 {
     if (state == InterstitialAdState.Ready || debugOverrideShow )
     {
         state = InterstitialAdState.Showing;
         StartCoroutine(DoShow(10f));
     }
     else
         throw new InvalidOperationException("Not Ready");
 }