Exemple #1
0
    public void ShowNativeAd()
    {
        RawImage icon       = GameObject.Find("icon").GetComponent <RawImage>();
        Text     headline   = GameObject.Find("headline").GetComponent <Text>();
        Button   cta        = GameObject.Find("nativeButton").GetComponent <Button>();
        RawImage image      = GameObject.Find("image").GetComponent <RawImage>();
        Text     advertiser = GameObject.Find("advertiser").GetComponent <Text>();
        Text     ctaText    = GameObject.Find("ctaText").GetComponent <Text>();

        icon.texture  = native.GetIconTexture2D();
        image.texture = native.GetImageTexture2D();
        cta.onClick.AddListener(delegate() { native.RecordClick(); });
        headline.text   = native.GetHeadline();
        advertiser.text = native.GetAdvertiser();
        ctaText.text    = native.GetCallToAction();

        native.RecordImpression();
    }