Example #1
0
        void NendAdInterstitial_OnFinishLoad(string message)
        {
            string[] array = message.Split(':');
            if (2 != array.Length)
            {
                return;
            }
            NendAdInterstitialStatusCode status = (NendAdInterstitialStatusCode)int.Parse(array [0]);
            string spotId = array [1];
            EventHandler <NendAdInterstitialLoadEventArgs> handler = AdLoaded;

            if (null != handler)
            {
                NendAdInterstitialLoadEventArgs args = new NendAdInterstitialLoadEventArgs();
                args.StatusCode = status;
                args.SpotId     = spotId;
                handler(this, args);
            }
            if (null != _callback)
            {
                if (_callback is NendAdInterstitialCallbackWithSpot)
                {
                    ((NendAdInterstitialCallbackWithSpot)_callback).OnFinishLoadInterstitialAd(status, spotId);
                }
                else
                {
                    _callback.OnFinishLoadInterstitialAd(status);
                }
            }
        }
Example #2
0
        void NendAdInterstitial_OnFinishLoad(string message)
        {
            string[] array = message.Split(':');
            if (2 != array.Length)
            {
                return;
            }
            NendAdInterstitialStatusCode status = (NendAdInterstitialStatusCode)int.Parse(array [0]);
            string spotId = array [1];
            EventHandler <NendAdInterstitialLoadEventArgs> handler = AdLoaded;

            if (null != handler)
            {
                NendAdInterstitialLoadEventArgs args = new NendAdInterstitialLoadEventArgs();
                args.StatusCode = status;
                args.SpotId     = spotId;
                handler(this, args);
            }
        }
Example #3
0
    public void OnFinishLoadInterstitialAd(object sender, NendAdInterstitialLoadEventArgs args)
    {
        Handheld.StopActivityIndicator();

        NendAdInterstitialStatusCode statusCode = args.StatusCode;

        switch (statusCode)
        {
        case NendAdInterstitialStatusCode.SUCCESS:
            // Move to the next scene when Interstitial-AD load completed.
            Debug.Log(">> OnFinishLoadInterstitialAd: SUCCESS");
            SceneManager.LoadScene("First");
            break;

        default:
            // When failed to get of Interstitial-AD, try to reload.
            Debug.Log(">> OnFinishLoadInterstitialAd: FAILURE");
            ReloadAd();
            break;
        }
    }