public bool ShowABanner(DelOnCloseBanner callback = null) { int displayBannerId = this.GetDisplayBannerId(); if (this.m_seenBanners.Contains(displayBannerId)) { return(false); } if (displayBannerId == 0) { return(false); } DbfRecord record = GameDbf.Banner.GetRecord(displayBannerId); string assetPath = (record != null) ? record.GetAssetName("PREFAB") : null; if ((record == null) || (assetPath == null)) { Debug.LogWarning(string.Format("No banner defined for bannerID={0}", displayBannerId)); return(false); } BannerPopup popup = GameUtils.LoadGameObjectWithComponent <BannerPopup>(assetPath); if (popup == null) { return(false); } this.AcknowledgeBanner(displayBannerId); popup.Show(record.GetLocString("TEXT"), callback); return(true); }
public bool ShowCustomBanner(string bannerAsset, string bannerText, DelOnCloseBanner callback = null) { BannerPopup popup = GameUtils.LoadGameObjectWithComponent <BannerPopup>(bannerAsset); if (popup == null) { return(false); } popup.Show(bannerText, callback); return(true); }
private void Button_OpenPopup_Click(object sender, RoutedEventArgs e) { Popup popup = new Popup(); BannerPopup.Create(popup, "Your appkey", "Your appscret"); }