protected void UpdateServerDataByBattleResult(DefendFightBtlResultNty result) { if (!this.modeInfo.ContainsKey(this.currentData.mode)) { return; } this.bossRandomRate = result.bossRandomRate; this.BroadcastRefreshEvent(); }
public void UpdateData(DefendFightBtlResultNty result) { if ((DefendFightManager.Instance.SelectDetailMode == DefendFightMode.DFMD.Hold || DefendFightManager.Instance.SelectDetailMode == DefendFightMode.DFMD.Save || DefendFightManager.Instance.SelectDetailMode == DefendFightMode.DFMD.Protect) && result.result.winnerId != EntityWorld.Instance.EntSelf.ID) { ResourceManager.SetSprite(this.ResultImage, ResourceManager.GetIconSprite("failure_bg_zi01")); ResourceManager.SetSprite(this.ResultImageFx, ResourceManager.GetIconSprite("win_Light_02")); } else { ResourceManager.SetSprite(this.ResultImage, ResourceManager.GetIconSprite("win_01")); ResourceManager.SetSprite(this.ResultImageFx, ResourceManager.GetIconSprite("win_Light_01")); } Debug.LogError(result.normalDropItems.get_Count() + "===========" + result.extendDropItems.get_Count()); for (int i = 0; i < this.rewardItems.get_childCount(); i++) { Object.Destroy(this.rewardItems.GetChild(i).get_gameObject()); } using (List <ItemBriefInfo> .Enumerator enumerator = result.normalDropItems.GetEnumerator()) { while (enumerator.MoveNext()) { ItemBriefInfo current = enumerator.get_Current(); if (current.cfgId == 1) { this.exp.set_text(current.count.ToString()); } else if (current.cfgId == 2) { this.gold.set_text(current.count.ToString()); } else { ItemShow.ShowItem(this.rewardItems, current.cfgId, current.count, false, null, 2001); } } } base.FindTransform("RewardBgsBoss").get_gameObject().SetActive(result.extendDropItems.get_Count() > 0); Transform transform = base.FindTransform("BossRewardItems"); for (int j = 0; j < transform.get_childCount(); j++) { Object.Destroy(transform.GetChild(j).get_gameObject()); } for (int k = 0; k < result.extendDropItems.get_Count(); k++) { ItemBriefInfo itemBriefInfo = result.extendDropItems.get_Item(k); ItemShow.ShowItem(transform, itemBriefInfo.cfgId, itemBriefInfo.count, false, null, 2001); } this.time.set_text(GameDataUtils.GetChineseContent(501004, false) + " " + TimeConverter.GetTime(result.result.killTargetUsedTime, TimeFormat.HHMMSS)); int id = (DefendFightManager.Instance.SelectDetailMode != DefendFightMode.DFMD.Protect) ? 513536 : 513537; this.num.set_text(string.Format(GameDataUtils.GetChineseContent(id, false), result.maxWave.ToString())); this.exitButton.onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickDefendExit); }
public void UpdateTowerCopyUI(DefendFightBtlResultNty result) { this.PassTimeTextContent = GameDataUtils.GetChineseContent(501004, false) + " " + TimeConverter.GetTime(result.result.killTargetUsedTime, TimeFormat.HHMMSS); int id = (DefendFightManager.Instance.SelectDetailMode != DefendFightMode.DFMD.Protect) ? 513536 : 513537; this.BtnTipTextContent = string.Format(GameDataUtils.GetChineseContent(id, false), result.maxWave.ToString()); List <ItemBriefInfo> normalDropItems = result.normalDropItems; if (normalDropItems != null && result.extendDropItems != null && result.extendDropItems.get_Count() > 0) { normalDropItems.AddRange(result.extendDropItems); } this.UpdateDungeonRewards(normalDropItems); }
protected void OnDefendFightBtlResultNty(short state, DefendFightBtlResultNty down = null) { Debug.Log("----------结算面板 OnDefendFightBtlResultNty----------"); if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } if (down == null) { return; } this.UpdateServerDataByBattleResult(down); TowerInstance.Instance.GetInstanceResult(down); }
public void Init(DefendFightBtlResultNty result) { if (result != null) { List <ItemBriefInfo> normalDrops = new List <ItemBriefInfo>(); base.FindTransform("Gold").get_gameObject().SetActive(false); base.FindTransform("Exp").get_gameObject().SetActive(false); for (int i = 0; i < result.normalDropItems.get_Count(); i++) { int cfgId = result.normalDropItems.get_Item(i).cfgId; long count = result.normalDropItems.get_Item(i).count; Items item = BackpackManager.Instance.GetItem(cfgId); if (item != null) { if (item.secondType == 15) { base.FindTransform("Gold").get_gameObject().SetActive(true); base.FindTransform("GoldNum").GetComponent <Text>().set_text(count.ToString()); } else if (item.secondType == 16) { base.FindTransform("Exp").get_gameObject().SetActive(true); base.FindTransform("ExpNum").GetComponent <Text>().set_text(count.ToString()); } else { normalDrops.Add(result.normalDropItems.get_Item(i)); } } } ListPool pool1 = base.FindTransform("Items").GetComponent <ListPool>(); pool1.Create(normalDrops.get_Count(), delegate(int index) { if (index < normalDrops.get_Count() && index < normalDrops.get_Count()) { int cfgId2 = normalDrops.get_Item(index).cfgId; long count2 = normalDrops.get_Item(index).count; Debug.LogError(string.Concat(new object[] { "普通掉落:", cfgId2, " ", count2 })); pool1.Items.get_Item(index).GetComponent <SpecialInstancePassItem>().SetData(cfgId2, count2); } }); ListPool pool2 = base.FindTransform("Item2s").GetComponent <ListPool>(); base.FindTransform("extral").get_gameObject().SetActive(result.extendDropItems.get_Count() > 0); pool2.Create(result.extendDropItems.get_Count(), delegate(int index) { if (index < result.extendDropItems.get_Count() && index < pool2.Items.get_Count()) { int cfgId2 = result.extendDropItems.get_Item(index).cfgId; long count2 = result.extendDropItems.get_Item(index).count; Debug.LogError(string.Concat(new object[] { "额外掉落:", cfgId2, " ", count2 })); pool2.Items.get_Item(index).GetComponent <SpecialInstancePassItem>().SetData(cfgId2, count2); } }); } }