public static void onNativeRequestResponse(TapsellNativeBannerAd result) { #if UNITY_ANDROID && !UNITY_EDITOR string zone = result.zoneId; if (result != null) { if (mMonoBehaviour != null && mMonoBehaviour.isActiveAndEnabled) { mMonoBehaviour.StartCoroutine(loadNativeBannerAdImages(result)); } else { // if (errorPool.ContainsKey (zoneId)) { // TapsellError error = new TapsellError(); // error.zoneId = zone; // error.error = "Invalid MonoBehaviour Object"; // requestNativeBannerErrorPool [zone](error); // errorPool[zoneId] (zoneId); // } } } else { if (requestErrorPool.ContainsKey(zone)) { // TapsellError error = new TapsellError(); // error.zoneId = zone; // error.error = "Invalid Result"; // requestNativeBannerErrorPool [zone](error); } // errorPool[zoneId] (zoneId); } #endif }
static IEnumerator loadNativeBannerAdImages(TapsellNativeBannerAd 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; } } if (nativeBannerResponsePool.ContainsKey(result.zoneId)) { nativeBannerResponsePool[result.zoneId] (result); } }