예제 #1
0
 public void ShowAdBanner(bool isShow)
 {
     if (!enableBanner)
     {
         return;
     }
     AdBanner.ShowAd(isShow);
 }
예제 #2
0
    private void Start()
    {
        m_AdBanner        = GameObject.Find("AdBanner").GetComponent <AdBanner>();
        m_AdInterstitial  = GameObject.Find("AdInterstitial").GetComponent <AdInterstitial>();
        m_AdRewardedVideo = GameObject.Find("AdRewardedVideo").GetComponent <AdRewardedVideo>();

        ReloadADS();
    }
예제 #3
0
파일: BuyMenu.cs 프로젝트: techntt/flipgun
    public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
    {
        // A non consumable product has been purchased by this user.
        if (String.Equals(args.purchasedProduct.definition.id, removeAds, StringComparison.Ordinal))
        {
            //User removed ads.
            Debug.Log("User removed ads");
            list.GetChild(0).GetChild(1).gameObject.SetActive(false);
            list.GetChild(0).GetChild(2).gameObject.SetActive(true);
            AdBanner.DestroyBanner();
            PlayerPrefs.SetInt("DisableAds", 1);
        }
        // A consumable product has been purchased by this user.
        else if (String.Equals(args.purchasedProduct.definition.id, pinchOfCoins, StringComparison.Ordinal))
        {
            //User got 10000 coins.
            Debug.Log("User got 10000 coins");
            Wallet.AddCoins(10000);
            Wallet.CoinBlast();
        }
        // A non consumable product has been purchased by this user.
        else if (String.Equals(args.purchasedProduct.definition.id, rocketPack, StringComparison.Ordinal))
        {
            //User bought rocket guns.
            Debug.Log("User got rocket guns pack");
            list.GetChild(3).GetChild(1).gameObject.SetActive(false);
            list.GetChild(3).GetChild(2).gameObject.SetActive(true);
            PlayerPrefs.SetInt("RocketPackBought", 1);
            PlayerPrefs.SetInt("GunBought9", 1);
            PlayerPrefs.SetInt("GunBought10", 1);
        }
        // A non consumable product has been purchased by this user.
        else if (String.Equals(args.purchasedProduct.definition.id, sniperPack, StringComparison.Ordinal))
        {
            //User bought sniper pack.
            Debug.Log("User got sniper guns pack");
            list.GetChild(2).GetChild(1).gameObject.SetActive(false);
            list.GetChild(2).GetChild(2).gameObject.SetActive(true);
            PlayerPrefs.SetInt("SniperPackBought", 1);
            PlayerPrefs.SetInt("GunBought4", 1);
            PlayerPrefs.SetInt("GunBought8", 1);
        }
        // Or ... an unknown product has been purchased by this user. Fill in additional products here....
        else
        {
            Debug.Log(string.Format("ProcessPurchase: FAIL. Unrecognized product: '{0}'", args.purchasedProduct.definition.id));
        }

        // Return a flag indicating whether this product has completely been received, or if the application needs
        // to be reminded of this purchase at next app launch. Use PurchaseProcessingResult.Pending when still
        // saving purchased products to the cloud, and when that save is delayed.
        return(PurchaseProcessingResult.Complete);
    }
예제 #4
0
 private void Awake()
 {
     if (ins == null)
     {
         ins = this;
         DontDestroyOnLoad(gameObject);
     }
     else if (ins != this)
     {
         Destroy(gameObject);
     }
 }
예제 #5
0
        private StackLayout CreateFooterSection()
        {
            var ad = new AdBanner()
            {
                Size = AdBanner.Sizes.Standardbanner
            };

            var bottomContent = new StackLayout()
            {
                Children = { ad }
            };

            return(bottomContent);
        }
예제 #6
0
        public HomePage(int parametro1)
        {
            this.iduser4 = parametro1;

            Title = "Colecciones";

            SetValue(NavigationPage.HasNavigationBarProperty, false);

            InitializeComponent();

            var adBanner = new AdBanner();

            adBanner.Size = AdBanner.Sizes.MediumRectangle;
            ContenedorAd.Children.Add(adBanner);

            Init();
        }
예제 #7
0
    public void AdBannerDidReceiveAdFail(string adsource)
    {
        int    type = AdConfigParser.SOURCE_TYPE_BANNER;
        AdInfo info = AdConfig.main.GetNextPriority(type);

        if (info != null)
        {
            AdBanner.InitAd(info.source);
            AdBanner.ShowAd(true);
        }
        else
        {
            if (callbackFinish != null)
            {
                callbackFinish(AdType.BANNER, AdStatus.FAIL, null);
            }
        }
    }
예제 #8
0
    public void InitAdBanner()
    {
        if (!enableBanner)
        {
            return;
        }
        if (Common.noad)
        {
            return;
        }
        bool isShowAdBanner = true;

        if (Common.isiOS)
        {
            if (!AppVersion.appCheckHasFinished)
            {
                //ios app审核不显示banner
                isShowAdBanner = false;
            }
        }

        if (Common.isAndroid)
        {
            if (!AppVersion.appCheckHasFinished)
            {
                //xiaomi app审核不显示banner
                isShowAdBanner = false;
            }
        }

        if (isShowAdBanner)
        {
            AdBanner.SetScreenSize(Screen.width, Screen.height);
            AdBanner.SetScreenOffset(0, Device.heightSystemHomeBar);
            {
                int    type   = AdConfigParser.SOURCE_TYPE_BANNER;
                string source = AdConfig.main.GetAdSource(type);
                AdBanner.InitAd(source);
                AdBanner.ShowAd(true);
            }
        }
    }
예제 #9
0
 public AdMobBanner admobGetBanner(AdBanner banner)
 {
     if (banner == AdBanner.Phone_320x50)
     {
         return(AdMobBanner.Phone_320x50);
     }
     else if (banner == AdBanner.Tablet_300x250)
     {
         return(AdMobBanner.Tablet_300x250);
     }
     else if (banner == AdBanner.Tablet_468x60)
     {
         return(AdMobBanner.Tablet_468x60);
     }
     else if (banner == AdBanner.Tablet_728x90)
     {
         return(AdMobBanner.Tablet_728x90);
     }
     else
     {
         return(AdMobBanner.SmartBanner);
     }
 }
예제 #10
0
        public YoutubeViewPage()
        {
            var youtubeViewModel = new YoutubeViewModel();

            BindingContext  = youtubeViewModel;
            Title           = "WhatsApp Fun Videos";
            BackgroundColor = Color.FromHex("#C70039");
            var adBanner = new AdBanner();

            adBanner.Size = AdBanner.Sizes.Standardbanner;
            var dataTemplate = new DataTemplate(() =>
            {
                var titleLabel = new Label
                {
                    TextColor = Color.White,
                    FontSize  = 20
                };

                var mediaImage = new Image
                {
                    HeightRequest = 205
                };

                titleLabel.SetBinding(Label.TextProperty, new Binding("Title"));
                mediaImage.SetBinding(Image.SourceProperty, new Binding("MediumThumbnailUrl"));

                return(new ViewCell
                {
                    View = new StackLayout
                    {
                        Orientation = StackOrientation.Vertical,
                        Padding = new Thickness(0, 0),
                        Children =
                        {
                            titleLabel,
                            mediaImage,
                        }
                    }
                });
            });

            var listView = new ListView
            {
                HasUnevenRows = true
            };

            listView.SetBinding(ListView.ItemsSourceProperty, "YoutubeItems");

            listView.ItemTemplate = dataTemplate;

            listView.ItemTapped += ListViewOnItemTapped;

            Content = new StackLayout
            {
                Padding  = new Thickness(0, 0),
                Children =
                {
                    listView,
                    adBanner
                }
            };
        }
예제 #11
0
 public void ShowAdBanner(bool isShow)
 {
     AdBanner.ShowAd(isShow);
 }