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

            hasPendingRequests = false;
            state = InterstitialAdState.Ready;
            Fire(AdCallback.Ready);
            if (playNextReady)
            {
                playNextReady = false;
                Show();
            }
        }
Ejemplo n.º 3
0
        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");
            }
        }
Ejemplo n.º 4
0
        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;
            }
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 9
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;
            }
        }
Ejemplo n.º 10
0
 public void Show()
 {
     if (state == InterstitialAdState.Ready || debugOverrideShow )
     {
         state = InterstitialAdState.Showing;
         StartCoroutine(DoShow(10f));
     }
     else
         throw new InvalidOperationException("Not Ready");
 }