public bool OnSortCondion(CSItem item) { // 如果不能进行进化 则不显示 if (!item.IsEvlotion()) { return(true); } return(false); }
// 更新信息 void UpdateInfo() { CSItem card = CardBag.Singleton.m_cardForDetail; if (null == card) { return; } // 如果卡牌ID为0则 是用预览卡牌(不是背包里的卡牌) 此时 加到最爱 进化 强化等按钮不显示 if (CardBag.Singleton.m_curOptinGuid.Equals(CSItemGuid.Zero)) { m_levelUpBtn.gameObject.SetActive(false); m_evolutionBtn.gameObject.SetActive(false); m_breachBtn.gameObject.SetActive(false); } else { m_levelUpBtn.gameObject.SetActive(card.IsStengthen()); m_evolutionBtn.gameObject.SetActive(card.IsEvlotion()); m_breachBtn.gameObject.SetActive(true); } m_grid.Reposition(); AddModel(card, m_model); HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null == heroInfo) { Debug.LogWarning("heroInfo == NULL heroInfo cardID:" + card.IDInTable); return; } m_cardPanel.Update(card.IDInTable); IconInfomation iconInfo = GameTable.IconInfoTableAsset.Lookup(heroInfo.ImageId); OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(heroInfo.Occupation); RaceInfo raceInfo = GameTable.RaceInfoTableAsset.LookUp(heroInfo.Type); // LevelUpInfo levelupInfo = GameTable.LevelUpTableAsset.LookUp(card.Level); m_cost.text = "" + heroInfo.Cost; m_phyAttack.text = "" + (int)card.GetPhyAttack(); m_magAttack.text = "" + (int)card.GetMagAttack(); m_hp.text = "" + (int)card.GetHp(); m_occupation.text = occupationInfo.m_name; m_type.text = raceInfo.m_name; m_curLevel.text = "" + card.Level; m_maxLevel.GetComponent <UILabel>().text = card.GetMaxLevel().ToString(); IconInfomation icon = GameTable.IconInfoTableAsset.Lookup(occupationInfo.m_iconId); m_occTexture.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); icon = GameTable.IconInfoTableAsset.Lookup(raceInfo.m_iconId); m_raceTexture.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); // 段位升级 UpdateDanData(card.BreakCounts); foreach (UICardDetailSkillItem item in m_skillList) { if (null != item) { item.HideWindow(); } } foreach (UICardDetailSkillItem item in m_passvieSkillList) { if (null != item) { item.HideWindow(); } } int i = 0; List <int> skillIDList = heroInfo.GetAllSkillIDList(); foreach (int skillId in skillIDList) { if (0 != heroInfo.NormalSkillIDList.Find(item => item == skillId)) { continue; } SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(skillId); if (null == skillInfo) { continue; } // 普通技能才被列入 if (skillInfo.SkillType != 0) { continue; } iconInfo = GameTable.IconInfoTableAsset.Lookup(skillInfo.Icon); if (null == iconInfo) { continue; } if (i < m_skillList.Length) { UICardDetailSkillItem item = m_skillList[i]; if (null == item) { item = UICardDetailSkillItem.Create(); m_skillList[i] = item; item.SetParent(m_skillParent.transform); item.SetPressCallbacked(OnShowTips); item.SetClickCallbacked(OnHideTips); } item.ShowWindow(); item.Update(skillId); i++; } } m_skillParent.GetComponent <UIGrid>().Reposition(); i = 0; bool bNone = true; foreach (int skillId in heroInfo.PassiveSkillIDList) { SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(skillId); if (null == skillInfo) { continue; } iconInfo = GameTable.IconInfoTableAsset.Lookup(skillInfo.Icon); if (null == iconInfo) { continue; } if (i >= m_passvieSkillList.Length) { continue; } bNone = false; UICardDetailSkillItem item = m_passvieSkillList[i]; if (null == item) { item = UICardDetailSkillItem.Create(); m_passvieSkillList[i] = item; item.SetParent(m_passiveSkillParent.transform); item.SetPressCallbacked(OnShowTips); item.SetClickCallbacked(OnHideTips); } item.ShowWindow(); item.Update(skillId); i++; } m_passiveSkillParent.GetComponent <UIGrid>().Reposition(); m_skillNoneLabel.gameObject.SetActive(bNone); }
void UpdateInfo() { UpdateCardInfo(); // 如果 升级卡牌 无效则 清空相关UI if (CardUpdateProp.Singleton.m_curLevelGuid.Equals(CSItemGuid.Zero)) { // 隐藏材料 列表 for (int i = 0; i < m_listMax; i++) { Parma parma = FindChildComponent <Parma>("" + i); if (null == parma) { continue; } parma.m_guid = CSItemGuid.Zero; parma.gameObject.SetActive(false); } } // 选择数 m_chosen.text = string.Format(Localization.Get("ChooeseNum"), OperateCardList.Singleton.LevelUpList.Count); // 持有数 m_hold.text = CardBag.Singleton.itemList.Count + "/" + CardBag.Singleton.GetBagCapcity(); // 升级的 基本卡牌 CSItem card = CardBag.Singleton.GetCardByGuid(CardUpdateProp.Singleton.m_curLevelGuid); if (null == card) { return; } HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null == info) { return; } IconInfomation imageInfo = GameTable.IconInfoTableAsset.Lookup(info.ImageId); if (null == imageInfo) { return; } LevelUpInfo levInfo = GameTable.LevelUpTableAsset.LookUp(card.Level); if (null == levInfo) { return; } // 记录升级前的各种数据 用于升级后的显示 CardUpdateProp.Singleton.SetOldData(); float process = (float)card.Exp / (float)levInfo.Monster_Exp; m_processBar.value = process; m_expPercent.text = card.Exp * 100 / levInfo.Monster_Exp + "%"; m_cardBG.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(imageInfo.dirName); m_levelTips.text = "LV" + card.Level; m_tupoCounts.text = "" + (info.BreakThroughCount - card.BreakCounts); // 需消耗的金币 int money = card.Level * OperateCardList.Singleton.LevelUpList.Count; m_costMoney.text = "" + money; // 持有金币 m_myMoney.text = "" + User.Singleton.GetMoney(); if (money > User.Singleton.GetMoney()) { m_costMoney.color = Color.red; } else { m_costMoney.color = Color.white; } // 基本卡牌的 int baseCardId = card.IDInTable; int index = 0; bool bBreak = false; // 是否显示突破信息 bool bWarning = false; // 是否显示提示有三星以上卡牌 作为材料 // 材料所提供的经验 int supplyExp = 0; // 将要突破的次数 int willBreakCounts = 0; // 材料卡牌列表 foreach (CSItemGuid item in OperateCardList.Singleton.LevelUpList) { // Parma parma = FindChildComponent <Parma>("" + index); if (null == parma) { continue; } GameObject obj = parma.gameObject; obj.SetActive(true); card = CardBag.Singleton.GetCardByGuid(item); if (null == card) { continue; } // 如果材料卡牌和 基本卡牌一样的 则 显示界限突破 信息 if (card.IDInTable == baseCardId) { bBreak = true; willBreakCounts++; } info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null == info) { continue; } // 如果是三星以上卡牌 if (info.Rarity >= 3) { bWarning = true; } // guid parma.m_guid = item; imageInfo = GameTable.IconInfoTableAsset.Lookup(info.headImageId); // 提供的经验 supplyExp = supplyExp + CardUpdateProp.Singleton.GetCardExpByLevel((int)card.IDInTable, card.Level); if (null == imageInfo) { continue; } // 头像 obj.transform.Find("Image").GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(imageInfo.dirName); RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity); if (null != rarityInfo) { imageInfo = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId); // 星级 obj.transform.Find("Rank").GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(imageInfo.dirName); } // 名称 obj.transform.Find("Name").GetComponent <UILabel>().text = info.StrName; // 等级 obj.transform.Find("Level").GetComponent <UILabel>().text = "" + card.Level; index++; } // 三星材料卡提示 m_warning.gameObject.SetActive(bWarning); // 升级后的 等级 int afterLV = 0; // 升级后的经验 int afterExp = 0; card = CardBag.Singleton.GetCardByGuid(CardUpdateProp.Singleton.m_curLevelGuid); CardUpdateProp.Singleton.GetLevelUpLVExp(card, supplyExp, willBreakCounts, out afterLV, out afterExp); // 经验 // 只显示 当前经验 并不播放动画 if (afterLV == 0) { m_levelBefore.gameObject.SetActive(true); m_levelBefore.GetComponent <Animation>().Stop(); Color color = Color.white; color.a = 1; m_levelBefore.color = color; m_levelBefore.GetComponent <TweenAlpha>().enabled = false; m_levelAfter.gameObject.SetActive(false); } // 当前经验和 升级后的经验 同时播放动画 else { // m_levelBefore.animation.Play("ui-cardstate-00"); // m_levelAfter.animation.Play("ui-cardstate-01"); m_levelBefore.GetComponent <TweenAlpha>().enabled = true; levInfo = GameTable.LevelUpTableAsset.LookUp(afterLV); int afterMaxExp = levInfo.Monster_Exp; int per = afterExp * 100 / afterMaxExp; m_levelAfter.gameObject.transform.Find("LevelTipsAfter").GetComponent <UILabel>().text = Localization.Get("CardLevel") + afterLV; if (per >= 100) { per = 100; } m_levelAfter.gameObject.transform.Find("LevelPercentAfter").GetComponent <UILabel>().text = per + "%"; m_levelAfter.gameObject.transform.Find("ExpAfter").GetComponent <UISlider>().value = ((float)per) / 100f; m_levelAfter.gameObject.SetActive(true); } // 突破信息显示 m_break.gameObject.SetActive(bBreak); // 隐藏其余的 列表 for (; index < m_listMax; index++) { Parma parma = FindChildComponent <Parma>("" + index); if (null == parma) { continue; } parma.m_guid = CSItemGuid.Zero; parma.gameObject.SetActive(false); } // 是否激活合成按钮 条件 是 基本卡可强化 有材料 够金钱 m_levelUpBtn.isEnabled = (OperateCardList.Singleton.LevelUpList.Count > 0) /*&&(money <= User.Singleton.GetMoney())*/; // 进化合成按钮是否激活 m_evolution.isEnabled = card.IsEvlotion(); m_grid.Reposition(); // 计算消耗金钱 // 把列表位置 提到最上面 m_listPanel.transform.Find("Progress").GetComponent <UIProgressBar>().value = 0; }
// 更新选项界面 void UpdateOption() { m_option.gameObject.SetActive(true); CSItem card = CardBag.Singleton.GetCardByGuid(CardBag.Singleton.m_curOptinGuid); HeroInfo hero = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); IconInfomation icon = GameTable.IconInfoTableAsset.Lookup(hero.headImageId); RaceInfo race = GameTable.RaceInfoTableAsset.LookUp(hero.Type); OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(hero.Occupation); RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(hero.Rarity); IconInfomation rarityIconInfo = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId); //设置角色头像图片 m_cardInfoMain.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); //设置星级图标 m_rarityTexture.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(rarityIconInfo.dirName); //设置种族图标 IconInfomation raceIcon = GameTable.IconInfoTableAsset.Lookup(race.m_iconId); m_cardInfoRace.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(raceIcon.dirName); //设置职业图标 IconInfomation occIcon = GameTable.IconInfoTableAsset.Lookup(occupationInfo.m_iconId); m_cardInfoOccupation.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(occIcon.dirName); m_optionName.text = hero.StrName; m_optionLevel.text = Localization.Get("CardLevel") + card.Level; m_opInfoOp.text = occupationInfo.m_name; m_optionHp.text = "" + card.GetHp(); m_optionMagAttack.text = "" + card.GetMagAttack(); m_optionPhyAttack.text = "" + card.GetPhyAttack(); m_optionRace.text = race.m_name; //根据是否为最爱 决定按钮显示 图片和头像图标显示 if (card.Love) { //button 按钮换图片 WorldParamInfo worldInfo = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enCancelLoveImageName); m_joinLoveSprite.spriteName = worldInfo.StringTypeValue; //显示最爱图标 m_cardInfoLove.gameObject.SetActive(true); } else { //button 按钮换图片 WorldParamInfo worldInfo = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enJoinLoveImageName); m_joinLoveSprite.spriteName = worldInfo.StringTypeValue; //隐藏最爱图标 m_cardInfoLove.gameObject.SetActive(false); } // 可强化 if (card.IsStengthen()) { m_stengThen.isEnabled = true; } else { m_stengThen.isEnabled = false; } //设置素材卡牌 GradeUpRequireInfo gradeInfo = GameTable.gradeUpRequireAsset.Lookup(card.m_id); if (null == gradeInfo) { return; } // 是否达到进化所需等级 if (card.IsEvlotion() && card.BreakCounts < gradeInfo.GradeUpTime) { m_evlotion.isEnabled = true; } else { m_evlotion.isEnabled = false; } //是否是代表卡 m_deputyLabel.gameObject.SetActive(false); m_chosenLable.gameObject.SetActive(false); if (User.Singleton.RepresentativeCard == CardBag.Singleton.m_curOptinGuid) { m_deputyLabel.gameObject.SetActive(true); } else { if (Team.Singleton.IsCardInTeam(CardBag.Singleton.m_curOptinGuid)) { m_chosenLable.gameObject.SetActive(true); } } //判断是否可以段位升级(待设定) }