public void OnClickBack(int backType) { TavernPanel.SetActive((BackType)backType == BackType.BackToTavern); if (Camera.main != null) { switch ((BackType)backType) { case BackType.BackToMain: iTween.MoveTo(Camera.main.gameObject, defaultCameraAllPos, 0.5f); break; case BackType.BackToTavern: iTween.MoveTo(Camera.main.gameObject, defaultCameraTavernPos, 0.5f); break; default: break; } heroInfoPanel.SetActive(false); for (int i = 0; i < RandomHeroesPosArr.Length; i++) { { RandomHeroesPosArr[i].gameObject.SetActive(true); } } } currentShowId = -1; currentBackType = (BackType)backType; }
public BackInfo(string DBName, List <DateTime> TimeList) { this.DBName = DBName; this.TargetName = DBName; this.TargetPath = "d:"; this.TimeList = TimeList; this.AutoType = BackType.每天备份; }
public Tile(BackType back, BlockType background, BlockType foreground) { if (IsSolid(Foreground) && ! IsSolid(Background)) throw new System.Exception("no"); Back = back; Background = background; Foreground = foreground; }
public Background(Game game, Texture2D texture, Vector2 velocity, BackType backgroundType) : base(game) { DrawOrder = backgroundCount; backgroundCount++; this.texture = texture; this.velocity = velocity; this.backgroundType = backgroundType; textureTiles = CalculateBackgroundRectangleList(); }
/// <summary>计算两个日期的时间差</summary> /// <param name="DateTime1">原日期</param> /// <param name="DateTime2">新日期</param> /// <param name="BackTypes">返回类型:天,小时,分钟,秒,毫秒,(X天或X小时或X分钟)</param> /// <returns>null或一个具体类型</returns> public static Object DateDiff(DateTime DateTime1, DateTime DateTime2, BackType BackTypes) { Object Diff = null; TimeSpan ts = DateTime2 - DateTime1; switch (BackTypes) { default: Diff = ts.TotalDays; break; case BackType.GetDays: Diff = ts.TotalDays; break; case BackType.GetHours: Diff = ts.TotalHours; break; case BackType.GetMinutes: Diff = ts.TotalMinutes; break; case BackType.GetSeconds: Diff = ts.TotalSeconds; break; case BackType.GetMilliseconds: Diff = ts.TotalMilliseconds; break; case BackType.GetString: String OutDiff = null; if (ts.Days >= 1) { OutDiff = ts.TotalDays + "天"; } else { if (ts.Hours >= 1) { OutDiff = ts.TotalHours + "小时"; } else { OutDiff = ts.TotalMinutes + "分钟"; } } Diff = OutDiff; break; } return(Diff); }
/// <summary>计算两个日期的时间差</summary> /// <param name="DateTime1">原日期</param> /// <param name="DateTime2">新日期</param> /// <param name="BackTypes">返回类型:天,小时,分钟,秒,毫秒,(X天或X小时或X分钟)</param> /// <returns>null或一个具体类型</returns> public static Object DateDiff(DateTime DateTime1, DateTime DateTime2, BackType BackTypes) { Object Diff = null; TimeSpan ts = DateTime2 - DateTime1; switch (BackTypes) { default: Diff = ts.TotalDays; break; case BackType.GetDays: Diff = ts.TotalDays; break; case BackType.GetHours: Diff = ts.TotalHours; break; case BackType.GetMinutes: Diff = ts.TotalMinutes; break; case BackType.GetSeconds: Diff = ts.TotalSeconds; break; case BackType.GetMilliseconds: Diff = ts.TotalMilliseconds; break; case BackType.GetString: String OutDiff = null; if (ts.Days >= 1) { OutDiff = ts.TotalDays + "天"; } else { if (ts.Hours >= 1) { OutDiff = ts.TotalHours + "小时"; } else { OutDiff = ts.TotalMinutes + "分钟"; } } Diff = OutDiff; break; } return Diff; }
private void SetDrinkQuality() { if (tagList.Count <= 1) { qualityName = "普通"; qualityType = BackType.normal; } else if (tagList.Count >= 2 && tagList.Count <= 3) { qualityName = "稀有"; qualityType = BackType.good; } else if (tagList.Count > 3) { qualityName = "完美"; qualityType = BackType.perfect; } }
/// <summary> /// 界面显示时初始化数据 /// </summary> protected override void OnShow(INotification notification) { LoadSprite.LoaderImage(m_Panel.beijing, "bg/qiuchang", false); backType = BackType.Main; m_Panel.PieceGrid.enabled = true; m_Panel.PieceGrid.BindCustomCallBack(UpdatePieceGrid); m_Panel.PieceGrid.StartCustom(); m_Panel.rewardGrid.enabled = true; m_Panel.rewardGrid.BindCustomCallBack(UpdateRewardGrid); m_Panel.rewardGrid.StartCustom(); freeInfo = LotteryConfig.GetLotteryInfoByType(1); diamondInfo = LotteryConfig.GetLotteryInfoByType(2); tenInfo = LotteryConfig.GetLotteryInfoByType(3); m_Panel.orangedesc.text = TextManager.GetUIString("UICard3"); m_Panel.orangeCount.text = tenInfo.capitalValue.ToString(); if (cardMediator == null) { cardMediator = Facade.RetrieveMediator("CardMediator") as CardMediator; } m_Panel.freeTimes.text = string.Format(TextManager.GetUIString("UICard7"), freeInfo.freeCount - cardInfo.euroFreeTimes); UpdateView(CardType.First); }
public EnvyBook(FictionBook fb) { Trace.Assert(fb != null); if (fb.description == null) { return; } CultureInfo ciDefault = Thread.CurrentThread.CurrentCulture; CultureInfo ciDoc = ciDefault; if (fb.description.titleinfo == null) { if (fb.description.custominfo != null) { // Title in english ??? // custominfo and titleinfo should have a common interface then... // this.title = fb.description.custominfo... } } else { this.title = fb.description.titleinfo.booktitle.Value; this.author = GetAuthors(fb.description.titleinfo.author); try { string sLang = fb.description.titleinfo.lang; if (!String.IsNullOrEmpty(sLang)) { // returns neutral culture!!! Beware when formatting ciDoc = CultureInfo.GetCultureInfoByIetfLanguageTag(sLang); this.language = ciDoc.EnglishName; // guess it ciDoc = CultureInfo.CreateSpecificCulture(sLang + "-" + sLang); } } catch { } if (fb.description.titleinfo.genre != null && fb.description.titleinfo.genre.Length > 0) { this._genre = GenreMap.GetPeerGenre(fb.description.titleinfo.genre[0].Value); } // this.year = fb.description.titleinfo.date.value.Year; if (fb.description.titleinfo.keywords != null) { this.keywords = fb.description.titleinfo.keywords.Value; } } if (fb.description.publishinfo != null) { this.publisher = fb.description.publishinfo.publisher.Value; this.year = fb.description.publishinfo.year; if (fb.description.publishinfo.isbn != null) { string sISBN = fb.description.publishinfo.isbn.Value; if (!String.IsNullOrEmpty(sISBN)) { Int64 isbn; if (Int64.TryParse(sISBN, out isbn)) { this.ISBN = isbn; } else { sISBN = sISBN.Replace(@"-", String.Empty); if (Int64.TryParse(sISBN, out isbn)) { this.ISBN = isbn; } } } } } if (fb.description.documentinfo != null) { this.distributer = GetAuthors(fb.description.documentinfo.author); this.releaseDate = GetDate(ciDoc, fb.description.documentinfo.date); this.edition = fb.description.documentinfo.version.ToString(); } this.back = BackType.Digital; this.format = FormatType.FictionBook; }
/// <summary> /// 点击事件 /// </summary> void OnClick(GameObject go) { if (go == m_Panel.backBtn.gameObject) { if (backType == BackType.Main) { ClosePanel(null); } else if (backType == BackType.Reward) { m_Panel.reward.gameObject.SetActive(false); m_Panel.lotter.gameObject.SetActive(true); backType = BackType.Main; } else { m_Panel.getballer.gameObject.SetActive(false); m_Panel.lotter.gameObject.SetActive(true); backType = BackType.Main; } } else if (go == m_Panel.freeBtn.gameObject) { if (PlayerMediator.playerInfo.euro < freeInfo.capitalValue) { GUIManager.PromptBuyEuro(); return; } ServerCustom.instance.SendClientMethods("onClientLottery", (Byte)1); } else if (go == m_Panel.purpleBtn.gameObject) { if (PlayerMediator.playerInfo.diamond < diamondInfo.capitalValue) { GUIManager.PromptBuyDiamod(TextManager.GetUIString("UIStore1")); return; } ServerCustom.instance.SendClientMethods("onClientLottery", (Byte)2); } else if (go == m_Panel.orangeBtn.gameObject) { if (PlayerMediator.playerInfo.diamond < tenInfo.capitalValue) { GUIManager.PromptBuyDiamod(TextManager.GetUIString("UIStore1")); return; } ServerCustom.instance.SendClientMethods("onClientLottery", (Byte)3); } else if (go == m_Panel.seeBtn.gameObject) { tabType = 6; backType = BackType.Reward; m_Panel.reward.gameObject.SetActive(true); m_Panel.lotter.gameObject.SetActive(false); m_Panel.allItem.value = true; List <object> listObj = new List <object>(); foreach (RewardInfo info in LotterRewardManager.configList.Values) { listObj.Add(info); } m_Panel.rewardGrid.AddCustomDataList(listObj); } else if (go == m_Panel.changeBtn.gameObject) { tabType = 1; backType = BackType.Baller; m_Panel.getballer.gameObject.SetActive(true); m_Panel.lotter.gameObject.SetActive(false); m_Panel.allBaller.value = true; List <object> listObj = new List <object>(); foreach (RewardInfo info in PieceSwitchConfig.configList.Values) { listObj.Add(info); } m_Panel.PieceGrid.AddCustomDataList(listObj); } else if (go == m_Panel.allBaller.gameObject) { if (tabType == 1) { return; } tabType = 1; List <object> listObj = new List <object>(); foreach (RewardInfo info in PieceSwitchConfig.configList.Values) { listObj.Add(info); } m_Panel.PieceGrid.AddCustomDataList(listObj); } else if (go == m_Panel.forward.gameObject) { if (tabType == 2) { return; } tabType = 2; AddBallerGrid("1"); } else if (go == m_Panel.middle.gameObject) { if (tabType == 3) { return; } tabType = 3; AddBallerGrid("2"); } else if (go == m_Panel.back.gameObject) { if (tabType == 4) { return; } tabType = 4; AddBallerGrid("3"); } else if (go == m_Panel.door.gameObject) { if (tabType == 5) { return; } tabType = 5; AddBallerGrid("4"); } else if (go == m_Panel.allItem.gameObject) { if (tabType == 6) { return; } tabType = 6; List <object> listObj = new List <object>(); foreach (RewardInfo info in LotterRewardManager.configList.Values) { listObj.Add(info); } m_Panel.rewardGrid.AddCustomDataList(listObj); } else if (go == m_Panel.baller.gameObject) { if (tabType == 7) { return; } tabType = 7; List <object> listObj = new List <object>(); foreach (RewardInfo info in LotterRewardManager.configList.Values) { if (info.itemType != 7) { continue; } listObj.Add(info); } m_Panel.rewardGrid.AddCustomDataList(listObj); } else if (go == m_Panel.equip.gameObject) { if (tabType == 8) { return; } tabType = 8; List <object> listObj = new List <object>(); foreach (RewardInfo info in LotterRewardManager.configList.Values) { if (info.itemType != 1) { continue; } listObj.Add(info); } if (listObj.Count == 0) { m_Panel.rewardGrid.ClearCustomGrid(); return; } m_Panel.rewardGrid.AddCustomDataList(listObj); } else if (go == m_Panel.material.gameObject) { if (tabType == 9) { return; } tabType = 9; List <object> listObj = new List <object>(); foreach (RewardInfo info in LotterRewardManager.configList.Values) { if (info.itemType != 2) { continue; } listObj.Add(info); } if (listObj.Count == 0) { m_Panel.rewardGrid.ClearCustomGrid(); return; } m_Panel.rewardGrid.AddCustomDataList(listObj); } }
public ShareazaBook(FictionBook fb) { Trace.Assert(fb != null); if (fb.description == null) return; CultureInfo ciDefault = Thread.CurrentThread.CurrentCulture; CultureInfo ciDoc = ciDefault; if (fb.description.titleinfo == null) { if (fb.description.custominfo != null) { // Title in english ??? // custominfo and titleinfo should have a common interface then... // this.title = fb.description.custominfo... } } else { this.title = fb.description.titleinfo.booktitle.Value; this.author = GetAuthors(fb.description.titleinfo.author); try { string sLang = fb.description.titleinfo.lang; if (!String.IsNullOrEmpty(sLang)) { // returns neutral culture!!! Beware when formatting ciDoc = CultureInfo.GetCultureInfoByIetfLanguageTag(sLang); this.language = ciDoc.EnglishName; // guess it ciDoc = CultureInfo.CreateSpecificCulture(sLang + "-" + sLang); } } catch { } if (fb.description.titleinfo.genre != null && fb.description.titleinfo.genre.Length > 0) { this._genre = GenreMap.GetRazaGenre(fb.description.titleinfo.genre[0].Value); } // this.year = fb.description.titleinfo.date.value.Year; if (fb.description.titleinfo.keywords != null) this.keywords = fb.description.titleinfo.keywords.Value; this.description = GetDescription(fb.description.titleinfo.annotation); } if (fb.description.publishinfo != null) { this.publisher = fb.description.publishinfo.publisher.Value; this.year = fb.description.publishinfo.year; if (fb.description.publishinfo.isbn != null) { string sISBN = fb.description.publishinfo.isbn.Value; if (!String.IsNullOrEmpty(sISBN)) { Int64 isbn; if (Int64.TryParse(sISBN, out isbn)) { this.ISBN = isbn; } else { sISBN = sISBN.Replace(@"-", String.Empty); if (Int64.TryParse(sISBN, out isbn)) { this.ISBN = isbn; } } } } } if (fb.description.documentinfo != null) { this.distributer = GetAuthors(fb.description.documentinfo.author); this.releaseDate = GetDate(ciDoc, fb.description.documentinfo.date); this.edition = fb.description.documentinfo.version.ToString(); } this.back = BackType.Digital; this.format = FormatType.FictionBook; }