public void reLoad() { if (!GuideManager.Instance.isGuideComplete()) { drawList = new LuckyDraw[1]; drawList[0] = new LuckyDraw(GuideGlobal.LUCKY_SID); base.reLoad(drawList.Length); return; } LuckyDraw[] arr = LuckyDrawManagerment.Instance.getLuckyDrawArr(); if (arr == null || arr.Length <= 0) { return; } //按策划要求排序 LuckyDraw temp; for (int i = 0; i < arr.Length - 1; i++) { for (int j = 0; j < arr.Length - i - 1; j++) { if (arr [j].getLuckyIndex() > arr [j + 1].getLuckyIndex()) { temp = arr [j]; arr [j] = arr [j + 1]; arr [j + 1] = temp; } } } drawList = arr; base.reLoad(arr.Length); }
//初始化所有抽奖信息 public void createAllLuckyDraw() { int[] sids = LuckyDrawSampleManager.Instance.getAllLuckyDarwIds(); array = new LuckyDraw[sids.Length]; for (int i = 0; i < sids.Length; i++) { array [i] = new LuckyDraw(sids [i]); } }
//初始化 public void init(LuckyDrawResults results, LuckyDraw lucky, int skipType, int skipIndex) { this.skipType = skipType; this.skipIndex = skipIndex; this.lucky = lucky; this.results = results; loadPirze(results); initContent(); CreateObjByCache(); Invoke("ShowAlert", 3.5f); }
// Token: 0x060019C3 RID: 6595 RVA: 0x0002F024 File Offset: 0x0002E024 public void AccoladesFetched(Interop.Accolades accolades) { if (null == accolades) { return; } LuckyDraw luckyDraw = accolades.GetLuckyDraw(); if (null == luckyDraw) { return; } Hud.ShowTreasureStreakBuff(luckyDraw.CurrentStreak, luckyDraw.IsStreakBroken); }
//加载数据 private void loadData() { psList = getRandomList(); for (int i = 0; i < prizeList.Count; i++) { prizeList [i].initInfo(psList [i]); } for (int i = 0; i < prizeShowList.Count; i++) { prizeShowList [i].clearDate(); prizeShowList [i].num.text = ""; prizeShowList [i].icon.gameObject.SetActive(false); } lucky = LuckyDrawManagerment.Instance.getStarLuckyDraw(); }
/* methods */ public void initContent(WindowBase win, Notice notice) { this.notice = notice as LuckyDrawNotice; sample = NoticeSampleManager.Instance.getNoticeSampleBySid(this.notice.sid); SidNoticeContent content = sample.content as SidNoticeContent; this.lucky = LuckyDrawManagerment.Instance.getLuckyDrawBySid(content.sids[0]); this.card = CardManagerment.Instance.createCard(lucky.getSample().ids[0]); this.win = win; this.openTimeNoticeText = LanguageConfigManager.Instance.getLanguage("LuckyCardContent_timeOpen"); this.closeTimeNoticeText = LanguageConfigManager.Instance.getLanguage("LuckyCardContent_timeOver"); // 与服务器通讯 if (sample.activiteDesc == "KUAFU") { titleTexture.gameObject.SetActive(true); (FPortManager.Instance.getFPort("LuckyCardFPort") as LuckyCardFPort).access(notice.sid, OnLoadDataResault); } else if (sample.activiteDesc == "LOCAL") { xs_titleTexture.gameObject.SetActive(true); (FPortManager.Instance.getFPort("LuckyCardLocalFPort") as LuckyCardLocalFPort).access(notice.sid, OnLoadDataResault); } }
// Token: 0x06001702 RID: 5890 RVA: 0x000286EC File Offset: 0x000276EC internal virtual void StoreAccolades(Victory.DataLayer.Serialization.Event.Accolades accolades) { this.accolades = new Interop.Accolades(); if (accolades.FinalRewards != null) { this.accolades.Reputation = accolades.FinalRewards.Rep; this.accolades.Tokens = accolades.FinalRewards.Tokens; } if (accolades.OriginalRewards != null) { this.accolades.OriginalReputation = accolades.OriginalRewards.Rep; this.accolades.OriginalTokens = accolades.OriginalRewards.Tokens; } this.accolades.HasLeveledUp = accolades.HasLeveledUp; if (accolades.LuckyDrawInfo != null) { LuckyDraw luckyDraw = this.accolades.GetLuckyDraw(); luckyDraw.HasLuckyDraw = (accolades.LuckyDrawInfo.Items != null && accolades.LuckyDrawInfo.Items.Count > 0); luckyDraw.SetCardDeck(accolades.LuckyDrawInfo.CardDeck); luckyDraw.NumCards = accolades.LuckyDrawInfo.NumCards; luckyDraw.NumBoxAnimations = accolades.LuckyDrawInfo.NumBoxAnimations; luckyDraw.CurrentStreak = accolades.LuckyDrawInfo.CurrentStreak; luckyDraw.IsStreakBroken = accolades.LuckyDrawInfo.IsStreakBroken; if (accolades.LuckyDrawInfo.Items != null) { foreach (LuckyDrawItem luckyDrawItem in accolades.LuckyDrawInfo.Items) { LuckyItem luckyItem = new LuckyItem(); luckyItem.SetVirtualItem(luckyDrawItem.VirtualItem); luckyItem.SetCategory(luckyDrawItem.VirtualItemType); luckyItem.SetDescription(luckyDrawItem.Description); luckyItem.SetIcon(luckyDrawItem.Icon); luckyItem.Value = luckyDrawItem.RemainingUseCount; luckyItem.Price = luckyDrawItem.ResellPrice; luckyItem.ItemType = Inventory.GetProductTypeFromString(luckyDrawItem.VirtualItemType); luckyItem.WasSold = luckyDrawItem.WasSold; luckyItem.PartID = luckyDrawItem.Hash; luckyDraw.AddItems(luckyItem); } } if (accolades.LuckyDrawInfo.Boxes != null) { foreach (LuckyDrawBox luckyDrawBox in accolades.LuckyDrawInfo.Boxes) { LuckyBox luckyBox = new LuckyBox(); luckyBox.IsValid = luckyDrawBox.IsValid; luckyBox.CategoryId = (LuckyBoxCategory)luckyDrawBox.LuckyDrawSetCategoryId; luckyBox.SetCategoryName(luckyDrawBox.LocalizationString); luckyDraw.AddBoxes(luckyBox); } } } if (accolades.RewardInfo != null) { foreach (Victory.DataLayer.Serialization.Event.RewardPart rewardPart in accolades.RewardInfo) { Interop.RewardPart rewardPart2 = new Interop.RewardPart(); rewardPart2.SetCategory(rewardPart.RewardCategory.ToString()); if (rewardPart.RepPart != 0) { rewardPart2.SetName(string.Format("REWARD_TYPE_{0}_REP", rewardPart.RewardType.ToString())); rewardPart2.SetType("rep"); rewardPart2.Value = rewardPart.RepPart; this.accolades.AddRewardParts(rewardPart2); } if (rewardPart.TokenPart != 0) { rewardPart2.SetName(string.Format("REWARD_TYPE_{0}_TOKEN", rewardPart.RewardType.ToString())); rewardPart2.SetType("tokens"); rewardPart2.Value = rewardPart.TokenPart; this.accolades.AddRewardParts(rewardPart2); } } } this.ScoringMethod.AccoladesFetched(this.accolades); }
public void updateLuckyDraw(LuckyDraw luckyDraw) { this.luckyDraw = luckyDraw; //根据不同的类型显示不同的文字 /* * if (luckyDraw.getDrawNum () > 0) * numLabel.text = (luckyDraw.getDrawNum () - luckyDraw.getCostDrawNum ()) + "/" + luckyDraw.getDrawNum (); * else * numLabel.text = "0"; */ // // if (luckyDraw.getTimeInfo () != "") // timeLabel.text = luckyDraw.getTimeInfo (); // else // timeLabel.transform.parent.gameObject.SetActive (false); showFreeBg(); bottomLabel.text = "x " + luckyDraw.getShowCostNum(); costLabel.text = luckyDraw.getCostNumInfo(); LuckyCostIcon.setToolCostIconName(luckyDraw.ways [0], costIcon); LuckyCostIcon.setToolCostIconName(luckyDraw.ways [0], havaIcon); ResourcesManager.Instance.LoadAssetBundleTexture("texture/luckydraw/luckyPic_" + luckyDraw.getIconId(), bgIcon); //+ goods.getIconId (), itemIcon); //jordenwu 提示可以购买次数 //拥有对应 //是否有免费的 // if(luckyDraw.sid==81001){ // //钻石召唤 不提示次数 // tipNumObj.SetActive(false); // }else{ bool ishavafree = luckyDraw.getFreeNum() > 0 ? true : false; if (ishavafree) { //直接提示免费次数 int num = luckyDraw.getFreeNum(); if (num <= 0) { tipNumObj.SetActive(false); } else { tipNumObj.SetActive(true); tipNumLabel.text = luckyDraw.getFreeNum().ToString(); } } else { //提示可以购买次数 int own = luckyDraw.getShowCostNum(); int needCost = luckyDraw.getCostNum(); int num = (own / needCost); if (num <= 0) { tipNumObj.SetActive(false); } else { tipNumObj.SetActive(true); tipNumLabel.text = num.ToString(); } } // } }
/* methods */ public void initContent(NoticeWindow win, Notice notice) { this.notice = notice as LuckyDrawNotice; SidNoticeContent content = notice.getSample().content as SidNoticeContent; this.lucky = LuckyDrawManagerment.Instance.getLuckyDrawBySid(content.sids [0]); this.luckySample = lucky.getSample(); this.win = win; this.openTimeNoticeText = LanguageConfigManager.Instance.getLanguage("s0503"); this.closeTimeNoticeText = LanguageConfigManager.Instance.getLanguage("s0570"); if (this.luckySample.idsType == "2") //限时抽装备 { showEquip = EquipManagerment.Instance.createEquip(luckySample.ids [0]); showGoods.setFatherWindow(this.win); showGoods.init(showEquip); drawButton1.gameObject.SetActive(true); drawButton2.gameObject.SetActive(true); gotoButton.gameObject.SetActive(false); equipTitle.SetActive(true); drawInfoDesc.gameObject.SetActive(true); radioCtrl.radioType = 2; } else { StarSoulSample tmpSample = StarSoulSampleManager.Instance.getStarSoulSampleBySid(luckySample.ids[0]); if (tmpSample != null) { showSoul = StarSoulManager.Instance.createStarSoul(luckySample.ids [0]); showGoods.init(showSoul); } else { showProp = PropManagerment.Instance.createProp(luckySample.ids [0]); showGoods.init(showProp); } showGoods.setFatherWindow(this.win); setNoticeOpenTime(); gotoButton.gameObject.SetActive(true); gotoButton.disableButton(noticeOpenTime - ServerTimeKit.getSecondTime() > 0); drawButton1.gameObject.SetActive(false); drawButton2.gameObject.SetActive(false); propTitle.gameObject.SetActive(true); drawInfoDesc.gameObject.SetActive(false); if (luckySample.idsType == "3") //luckysample isdType 3 猎魂 4 炼金 { radioCtrl.radioType = 3; if (luckySample.name.EndsWith("1")) { propTitle.spriteName = "kf_xs_xinghun"; propTitle.gameObject.SetActive(true); xs_liehun.gameObject.SetActive(false); } else { propTitle.gameObject.SetActive(false); xs_liehun.gameObject.SetActive(true); } gotoButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("StarSoulWindow_Hunt_go"); } if (luckySample.idsType == "4") { showRadio.SetActive(false); if (luckySample.name.EndsWith("1")) { propTitle.spriteName = "kf_xs_lianjin"; propTitle.gameObject.SetActive(true); xs_lianjin.gameObject.SetActive(false); } else { propTitle.gameObject.SetActive(false); xs_lianjin.gameObject.SetActive(true); } gotoButton.textLabel.text = LanguageConfigManager.Instance.getLanguage("go_get_money"); } } // 与服务器通讯 if (luckySample.idsType == "2") { (FPortManager.Instance.getFPort("LuckyEquipFPort") as LuckyEquipFPort).access(notice.sid, OnLoadDataResault); } else { (FPortManager.Instance.getFPort("LuckyXianshiFPort") as LuckyXianshiFPort).access(notice.sid, OnLoadDataResault, StringKit.toInt(luckySample.idsType)); } }
//初始化 public void init(LuckyDrawResults results, LuckyDraw lucky) { init(results, lucky, 0, 0); }
//设置抽奖条目 public void setLuckyDraw(LuckyDraw lucky) { this.lucky = lucky; showInfo(); }