Example #1
0
    void Update()
    {
        if (nativeLoaded)
        {
            nativeLoaded = false;

            //get data
            Texture2D image      = this.adNative.GetImageTextures() [0];
            Texture2D adchoice   = this.adNative.GetAdChoicesLogoTexture();
            string    headline   = this.adNative.GetHeadlineText();
            string    bodyText   = this.adNative.GetBodyText();
            string    advertiser = this.adNative.GetAdvertiserText();
            string    cta        = this.adNative.GetCallToActionText();

            //assign values
            adImage.texture     = image;
            adChoices.texture   = adchoice;
            adHeadline.text     = headline;
            adBodyText.text     = bodyText;
            adAdvertiser.text   = advertiser;
            adCallToAction.text = cta;

            //register gameobjects to recieve events (click..)
            adNative.RegisterAdChoicesLogoGameObject(adChoices.gameObject);
            adNative.RegisterHeadlineTextGameObject(adHeadline.gameObject);
            adNative.RegisterBodyTextGameObject(adBodyText.gameObject);
            adNative.RegisterAdvertiserTextGameObject(adAdvertiser.gameObject);
            adNative.RegisterCallToActionGameObject(adCallToAction.gameObject);


            nativeAdPanel.SetActive(true);
        }
    }
    void Update()
    {
        if (nativeLoaded)
        {
            nativeLoaded = false;

            Texture2D iconTexture   = this.adNative.GetIconTexture();
            Texture2D iconAdChoices = this.adNative.GetAdChoicesLogoTexture();
            string    headline      = this.adNative.GetHeadlineText();
            string    cta           = this.adNative.GetCallToActionText();
            string    advertiser    = this.adNative.GetAdvertiserText();
            adIcon.texture      = iconTexture;
            adChoices.texture   = iconAdChoices;
            adHeadline.text     = headline;
            adAdvertiser.text   = advertiser;
            adCallToAction.text = cta;

            //register gameobjects
            adNative.RegisterIconImageGameObject(adIcon.gameObject);
            adNative.RegisterAdChoicesLogoGameObject(adChoices.gameObject);
            adNative.RegisterHeadlineTextGameObject(adHeadline.gameObject);
            adNative.RegisterCallToActionGameObject(adCallToAction.gameObject);
            adNative.RegisterAdvertiserTextGameObject(adAdvertiser.gameObject);

            adNativePanel.SetActive(true);              //show ad panel
        }
    }
 public void RegisterCallToActionGameObject(GameObject gameObject)
 {
     if (CallTapsellRegister(gameObject))
     {
         return;
     }
     _unifiedNativeAd.RegisterCallToActionGameObject(gameObject);
 }