Beispiel #1
0
 public static void onNativeBannerRequestFilled(TapsellNativeBannerResult result)
 {
                 #if UNITY_ANDROID && !UNITY_EDITOR
     string zone = result.zoneId;
     if (result != null)
     {
         if (mMonoBehaviour != null && mMonoBehaviour.isActiveAndEnabled)
         {
             mMonoBehaviour.StartCoroutine(loadNativeBannerAdImages(result));
         }
         else
         {
             if (requestNativeBannerErrorPool.ContainsKey(zone))
             {
                 TapsellError error = new TapsellError();
                 error.zoneId = zone;
                 error.error  = "Invalid MonoBehaviour Object";
                 requestNativeBannerErrorPool [zone](error);
             }
         }
     }
     else
     {
         if (requestNativeBannerErrorPool.ContainsKey(zone))
         {
             TapsellError error = new TapsellError();
             error.zoneId = zone;
             error.error  = "Invalid Result";
             requestNativeBannerErrorPool [zone](error);
         }
     }
                 #endif
 }
Beispiel #2
0
        static IEnumerator loadNativeBannerAdImages(TapsellNativeBannerResult result)
        {
            if (result.iconUrl != null && !result.iconUrl.Equals(""))
            {
                WWW wwwIcon = new WWW(result.iconUrl);
                yield return(wwwIcon);

                if (wwwIcon.texture != null)
                {
                    result.iconImage = wwwIcon.texture;
                }
            }
            if (result.portraitStaticImageUrl != null && !result.portraitStaticImageUrl.Equals(""))
            {
                WWW wwwPortrait = new WWW(result.portraitStaticImageUrl);
                yield return(wwwPortrait);

                if (wwwPortrait.texture != null)
                {
                    result.portraitBannerImage = wwwPortrait.texture;
                }
            }
            if (result.landscapeStaticImageUrl != null && !result.landscapeStaticImageUrl.Equals(""))
            {
                WWW wwwLandscape = new WWW(result.landscapeStaticImageUrl);
                yield return(wwwLandscape);

                if (wwwLandscape.texture != null)
                {
                    result.landscapeBannerImage = wwwLandscape.texture;
                }
            }
            string zone = result.zoneId;

            if (requestNativeBannerFilledPool.ContainsKey(zone))
            {
                requestNativeBannerFilledPool [zone](result);
            }
        }