public void Update() { if (this.isAdLoaded) { if (!this.isAdDisplayed) { this.isAdDisplayed = true; Material material = adObjectUnity.GetAdObject().GetComponent <Renderer> ().material; material.SetFloat("_Glossiness", 0.0f); material.mainTexture = ((TextureUnity)instance.GetDiffuseTexture()).GetTextureObject(); } instance.UpdateVisibilityMetric(); } }
public void OnAdUnitLoaded(Object context) { ImageTextureAdUnit adUnit = (ImageTextureAdUnit)context; ImageTextureAdInstance instance1 = adUnit.CreateInstance("adds", new AdObjectUnity()); ImageTextureAdInstance instance2 = adUnit.CreateInstance("sdfdf", new AdObjectUnity()); TextureUnity texture1 = (TextureUnity)instance1.GetDiffuseTexture(); TextureUnity texture2 = (TextureUnity)instance2.GetDiffuseTexture(); byte[] data1 = texture1.GetTextureData(); byte[] data2 = texture2.GetTextureData(); if (texture1 != null) { Console.WriteLine("Non null first instance"); } if (texture2 != null) { Console.WriteLine("Non null second instanc"); } Console.WriteLine("adLoadFinished"); }