Esempio n. 1
0
        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");
        }
        public void OnAdUnitLoaded(System.Object context)
        {
            //AdManager.GetAdsLoaded ().Add ( ((ImageTextureAdUnit)context).GetAdUnitId() , true);
            ImageTextureAdUnit adUnit      = (ImageTextureAdUnit)context;
            ArrayList          instanceIds = AdManagerUnity.GetInstanceIdsByAdUnitId(adUnit.GetAdUnitId());

            foreach (String instanceId in instanceIds)
            {
                ImageTextureAdInstanceUnity instance = AdManagerUnity.GetImageTextureAdInstanceUnity(instanceId);
                instance.SetInstance(adUnit.CreateInstance(instance.GetAdInstanceId(), instance.GetAdObject()));
                instance.CallOnAdUnitLoaded();
            }
        }