public bool OnSortCondion(CSItem item) { // 如果不可强化 则不显示出来 if (!item.IsStengthen()) { 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 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); } } //判断是否可以段位升级(待设定) }