//清空素材列表 void ResetMaterialList() { foreach (UICardHead item in m_materialList) { item.Destroy(); } m_materialList.Clear(); if (null != m_cardBeforHead) { m_cardBeforHead.Destroy(); m_cardBeforHead = null; } if (null != m_cardAfterHead) { m_cardAfterHead.Destroy(); m_cardAfterHead = null; } foreach (var item in m_modelDataList) { UIManager.Singleton.HideModel(item.m_obj as GameObject); } m_modelDataList.Clear(); foreach (UISprite item in m_materialSpritList) { Transform labelTransform = item.transform.Find("MateriaLabel"); labelTransform.gameObject.SetActive(false); Transform texure = item.transform.Find("Sprite"); WorldParamInfo worldInfo = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enCardDivisionNullMaterialIcon); IconInfomation imageInfo = GameTable.IconInfoTableAsset.Lookup(worldInfo.IntTypeValue); texure.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(imageInfo.dirName); Transform Startexure = item.transform.Find("Texture"); Startexure.gameObject.SetActive(false); item.GetComponent <Parma>().m_type = 0; } }
public void Update(int cardId) { HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(cardId); if (null == heroInfo) { return; } m_name.text = heroInfo.StrName; m_cardNumber.text = heroInfo.CardId + ""; IconInfomation iconInfo = GameTable.IconInfoTableAsset.Lookup(heroInfo.ImageId); m_card.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(heroInfo.Occupation); iconInfo = GameTable.IconInfoTableAsset.Lookup(occupationInfo.m_iconId); m_occ.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(heroInfo.Rarity); iconInfo = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId); m_rarity.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); }
public IconInfomation Lookup(int id) { IconInfomation info = null; m_list.TryGetValue(id, out info); return(info); }
void OnSkillLevelUp() { if (LevelUp.Singleton.m_skillList.Count == 0) { return; } SkillLevelUpInfo info = LevelUp.Singleton.m_skillList[0]; int skillId = info.m_skillId; SkillInfo skiillInfo = GameTable.SkillTableAsset.Lookup(skillId); if (null == skiillInfo) { Debug.LogWarning("OnSkillLevelUp skiillInfo == null skillId:" + skillId); return; } IconInfomation iconInfo = GameTable.IconInfoTableAsset.Lookup(skiillInfo.Icon); m_icon.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); string str = string.Format(Localization.Get("SkillLevelUp"), skiillInfo.Name, info.m_skillLevel); m_info.GetComponent <UILabel>().text = str; }
void ShowBattleHelper(int userGUID) { Helper helper = User.Singleton.HelperList.LookupHelper(userGUID); if (helper == null) { Debug.Log("No this helper, id = " + userGUID.ToString()); ShowSelf(); return; } m_btnTeamLeaderModel.SetActive(false); m_btnCancelTeamLeaderMode.SetActive(false); m_btnSelectThis.SetActive(true); m_btnChangeCard.SetActive(false); //userinfo m_userName.text = helper.m_userName; m_userLevel.text = Localization.Get("CardLevel") + helper.m_userLevel.ToString(); m_labelGUID.text = "ID:" + helper.m_userGuid.ToString(); CSItem card = new CSItem(); card.Guid = helper.m_cardGuid; card.m_id = (short)helper.m_cardId; card.Level = helper.m_cardLevel; card.BreakCounts = helper.m_cardBreakCounts; card.m_segment.m_heroCard.m_skill = helper.m_cardSkill; //代表卡info // CSItemGuid cardGuid = User.Singleton.RepresentativeCard; // CSItem card = CardBag.Singleton.GetCardByGuid(cardGuid); if (card != null) { Debug.Log("RefreshInfo"); HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (info == null) { return; } int headImageID = info.headImageId; IconInfomation icon = GameTable.IconInfoTableAsset.Lookup(headImageID); m_cardPortrait.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); m_cardName.text = info.StrName; m_cardLevel.text = card.Level.ToString(); RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity); icon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId); m_raritySprite.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); int occ = info.Occupation; int race = info.Type; string occName = GameTable.OccupationInfoAsset.LookUp(occ).m_name; string raceName = GameTable.RaceInfoTableAsset.LookUp(race).m_name; m_occAndRace.text = occName + " " + raceName; m_phyAttack.text = ((int)card.GetPhyAttack()).ToString(); m_magAttack.text = ((int)card.GetMagAttack()).ToString(); m_hp.text = ((int)card.GetHp()).ToString(); m_breakthroughTimes.text = card.BreakCounts.ToString(); } }
// 更新卡牌界面相关信息 public void UpdateInfo(CSItemGuid guid) { CSItem cardInfo = CardBag.Singleton.itemBag.GetItemByGuid(guid); if (cardInfo == null) { return; } // 卡牌ID int id = cardInfo.IDInTable; HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(id); if (null == info) { Debug.Log("UICard UpdateInfo HeroInfo 表数据没有 ID 为:" + id); return; } // 星级 SetRarity(info.Rarity); RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity); if (null == rarityInfo) { Debug.Log("UICard UpdateInfo RarityRelativeInfo 表数据没有 ID 为:" + id); return; } IconInfomation imageInfo = GameTable.IconInfoTableAsset.Lookup(info.ImageId); if (null == imageInfo) { return; } // 消耗 m_cardCost.text = info.Cost.ToString(); m_cardName.text = info.StrName.ToString(); m_card.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(imageInfo.dirName); // 计算生命值 float hp = cardInfo.GetHp(); m_cardHp.text = hp.ToString(); // 计算物理攻击力 float attack = cardInfo.GetPhyAttack(); m_cardAttack.text = attack.ToString(); Debug.Log("UICard UpdateInfo:" + info.StrName); }
void UpdateBaseInfo() { m_text.text = RUSure.Singleton.m_text; m_titelText.text = RUSure.Singleton.m_titelText; IconInfomation info = GameTable.IconInfoTableAsset.Lookup(RUSure.Singleton.m_iconId); m_icon.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(info.dirName); m_useText.text = RUSure.Singleton.m_useText; }
public void NewCard(int cardId) { HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(cardId); if (null == info) { Debug.Log("UIChooseCard NewCard HeroInfo 表数据没有 ID 为:" + cardId); return; } GameObject item = null; if (m_itemList.ContainsKey(cardId)) { item = m_itemList[cardId]; } else { item = GameObject.Instantiate(m_cardItem) as GameObject; item.gameObject.SetActive(true); // 设置 父物体 item.transform.parent = FindChildComponent <UIGrid>("Grid").transform; // 设置大小 item.transform.localScale = m_cardItem.transform.localScale; Parma param = item.transform.Find("Button").GetComponent <Parma>(); param.m_id = cardId; // 设置按钮名称 item.transform.Find("Button").name = cardId.ToString(); m_itemList.Add(cardId, item); } // 设置图片 UITexture cardBg = item.transform.Find("CardBG").GetComponent <UITexture>(); IconInfomation iconInfo = GameTable.IconInfoTableAsset.Lookup(info.ImageId); if (null != iconInfo) { cardBg.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); } UILabel cardName = item.transform.Find("CardName").GetComponent <UILabel>(); cardName.text = info.StrName; AddChildMouseClickEvent(cardId.ToString(), OnChoose); }
public void Load(byte[] bytes) { m_list = new Dictionary <int, IconInfomation>(); BinaryHelper helper = new BinaryHelper(bytes); int length = helper.ReadInt(); for (int index = 0; index < length; ++index) { IconInfomation info = new IconInfomation(); info.Load(helper); m_list.Add(info.ID, info); } }
// 更新 强化成功信息 并显示出来 void UpdateSuccessInfo() { m_success.gameObject.SetActive(true); CSItem card = CardBag.Singleton.GetCardByGuid(CardUpdateProp.Singleton.m_levelUpAfterGuid); 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; } // 突破次数 int breakNum = card.BreakCounts - CardUpdateProp.Singleton.m_oldBreak; if (breakNum > 0) { m_successBreak.text = string.Format(Localization.Get("BreakNum"), breakNum); } else { m_successBreak.text = ""; } m_successCardBG.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(imageInfo.dirName); // 升级前的数据 m_oldLv.text = CardUpdateProp.Singleton.m_oldLevelTips; m_oldHp.text = "" + CardUpdateProp.Singleton.m_oldHP; m_oldMagAttack.text = "" + CardUpdateProp.Singleton.m_oldMagAtk; m_oldPhyAttack.text = "" + CardUpdateProp.Singleton.m_oldPhyAtk; // 升级后的数据 m_newLv.text = card.Level + "/" + card.GetMaxLevel(); m_newHp.text = "" + (int)card.GetHp(); m_newMagAttack.text = "" + card.GetMagAttack(); m_newPhyAttack.text = "" + card.GetPhyAttack(); }
// 添加 队伍索引按钮 void AddTeamIndexItem() { for (int i = 0; i < m_teamIndexList.Count; i++) { m_teamIndexList[i].SetActive(false); } GameObject obj = null; for (int i = 0; i < Team.Singleton.TeamNum; i++) { // 如果不存在 则创建 if (false == m_teamIndexList.ContainsKey(i)) { obj = GameObject.Instantiate(m_teamIndexItem.gameObject) as GameObject; obj.transform.parent = m_teamIndexItem.transform.parent; obj.transform.localScale = m_teamIndexItem.transform.localScale; obj.transform.localRotation = m_teamIndexItem.transform.localRotation; obj.transform.localPosition = m_teamIndexItem.transform.localPosition; obj.name = obj.name + i; AddChildMouseClickEvent(obj.name, OnChangTeam); m_teamIndexList.Add(i, obj); } obj = m_teamIndexList[i].gameObject; Parma parma = obj.GetComponent <Parma>(); parma.m_id = i; obj.SetActive(true); obj.GetComponent <UIToggle>().value = Team.Singleton.m_curTeamIndex == i; // 设置职业图标 CSItem card = Team.Singleton.GetCard(i, Team.EDITTYPE.enMain); if (null != card) { HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null != info) { OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(info.Occupation); IconInfomation iconInfo = GameTable.IconInfoTableAsset.Lookup(occupationInfo.m_iconId); obj.transform.Find("OccPic").GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); } } else { obj.transform.Find("OccPic").GetComponent <UITexture>().mainTexture = null; } } }
// 更新卡牌界面相关信息 public void UpdateInfo(CSItemGuid guid) { CSItem card = CardBag.Singleton.GetCardByGuid(guid); if (null == card) { return; } m_name.text = ""; HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null == info) { Debug.Log("UICard UpdateInfo HeroInfo 表数据没有 ID 为:" + card.IDInTable); return; } IconInfomation imageInfo = GameTable.IconInfoTableAsset.Lookup(info.ImageId); if (null == imageInfo) { return; } m_card.mainTexture = PoolManager.Singleton.LoadIcon<Texture>(imageInfo.dirName); m_name.text = info.StrName; m_attirbutename.name = info.StrName; // 星级 RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity); if (null == rarityInfo) { return; } IconInfomation icon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId); m_cardRarity.GetComponent<UITexture>().mainTexture = PoolManager.Singleton.LoadIcon<Texture>(icon.dirName); // 消耗 m_cardCost.text = info.Cost.ToString(); // 生命值 m_cardHp.text = card.GetHp().ToString(); m_magAttack.text = card.GetMagAttack().ToString(); m_cardAttack.text = card.GetPhyAttack().ToString(); }
//切入技改变 void SwitchSkillChanged() { if (ActorManager.Singleton.Support == null || ActorManager.Singleton.Support.SkillBag.Count == 0) { return; } GameObject skill = m_sameInfoList[SwitchSkillIndex].m_objSkill; GameObject enabled = FindChild("Enabled", skill); UITexture sprite = FindChildComponent <UITexture>("skill", skill); Actor.ActorSkillInfo info = ActorManager.Singleton.Support.SkillBag[0]; IconInfomation iconInfo = GameTable.IconInfoTableAsset.Lookup(info.SkillTableInfo.Icon); sprite.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); Material curMaterial = sprite.material; if (info.IsSilence) {//技能被沉默 enabled.SetActive(true); curMaterial = m_diableMaterial; } else { if (m_mainPlayer.CurrentTargetIsDead) {//无目标 enabled.SetActive(true); curMaterial = m_diableMaterial; } else { if (!ActorTargetManager.IsEnemy(m_mainPlayer, m_mainPlayer.CurrentTarget)) {//当前目标不是敌人 enabled.SetActive(true); curMaterial = m_diableMaterial; } else { enabled.SetActive(false); curMaterial = m_normalMaterial; } } } //if (sprite.material != curMaterial) { sprite.material = curMaterial; } }
public void Update(int skillId) { CSItem card = CardBag.Singleton.m_cardForDetail; if (card == null) { return; } SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(skillId); if (null == skillInfo) { return; } IconInfomation iconInfo = GameTable.IconInfoTableAsset.Lookup(skillInfo.Icon); WindowRoot.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); // 身上是否有此技能 m_lock.SetActive(!card.HaveSkill(skillId)); int frameIconId = 0; // 是否是 切入技 if (card.IsSwitchSkill(skillId)) { frameIconId = (int)ENWorldParamIndex.enCardDetailSpecilSkillFrame; } else { frameIconId = (int)ENWorldParamIndex.enCardDetailSkillFrame; } WorldParamInfo worldInfo = GameTable.WorldParamTableAsset.Lookup(frameIconId); if (worldInfo != null) { iconInfo = GameTable.IconInfoTableAsset.Lookup(worldInfo.IntTypeValue); m_frame.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); } m_param.m_id = skillId; }
void ShowSelf() { m_btnTeamLeaderModel.SetActive(User.Singleton.IsTeamLeaderModel); m_btnCancelTeamLeaderMode.SetActive(!User.Singleton.IsTeamLeaderModel); m_btnSelectThis.SetActive(false); m_btnChangeCard.SetActive(true); //userinfo m_userName.text = User.Singleton.UserProps.GetProperty_String(UserProperty.name); m_userLevel.text = Localization.Get("CardLevel") + User.Singleton.UserProps.GetProperty_Int32(UserProperty.level).ToString(); m_labelGUID.text = "ID:" + User.Singleton.Guid.ToString(); //代表卡info CSItemGuid cardGuid = User.Singleton.RepresentativeCard; CSItem card = CardBag.Singleton.GetCardByGuid(cardGuid); if (card != null) { Debug.Log("RefreshInfo"); HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (info == null) { return; } int headImageID = info.headImageId; IconInfomation icon = GameTable.IconInfoTableAsset.Lookup(headImageID); m_cardPortrait.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); m_cardName.text = info.StrName; m_cardLevel.text = card.Level.ToString(); RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity); icon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId); m_raritySprite.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); int occ = info.Occupation; int race = info.Type; string occName = GameTable.OccupationInfoAsset.LookUp(occ).m_name; string raceName = GameTable.RaceInfoTableAsset.LookUp(race).m_name; m_occAndRace.text = occName + " " + raceName; m_phyAttack.text = ((int)card.GetPhyAttack()).ToString(); m_magAttack.text = ((int)card.GetMagAttack()).ToString(); m_hp.text = ((int)card.GetHp()).ToString(); m_breakthroughTimes.text = card.BreakCounts.ToString(); } }
public void ShowFriendPlayerInfo(FriendItem friendItem) { m_btnTeamLeaderModel.SetActive(false); m_btnCancelTeamLeaderMode.SetActive(false); FindChild("FriendBtnList").SetActive(true); FindChild("RepresentativeBtnList").SetActive(false); m_frienditem = friendItem; m_userName.text = friendItem.m_actorName; m_userLevel.text = Localization.Get("CardLevel") + friendItem.m_level; m_labelGUID.text = "ID:" + "000000"; CSItem card = friendItem.GetItem(); if (card != null) { Debug.Log("RefreshInfo"); HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (info == null) { return; } int headImageID = info.headImageId; IconInfomation icon = GameTable.IconInfoTableAsset.Lookup(headImageID); m_cardPortrait.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); m_cardName.text = info.StrName; m_cardLevel.text = card.Level.ToString(); RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity); icon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId); m_raritySprite.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); int occ = info.Occupation; int race = info.Type; string occName = GameTable.OccupationInfoAsset.LookUp(occ).m_name; string raceName = GameTable.RaceInfoTableAsset.LookUp(race).m_name; m_occAndRace.text = occName + " " + raceName; m_phyAttack.text = ((int)card.GetPhyAttack()).ToString(); m_magAttack.text = ((int)card.GetMagAttack()).ToString(); m_hp.text = ((int)card.GetHp()).ToString(); m_breakthroughTimes.text = card.BreakCounts.ToString(); } ShowWindow(); }
public override void OnInit() { base.OnInit(); AddPropChangedNotify((int)MVCPropertyID.enGameSeting, OnPropertyChanged); m_gridList = new Dictionary <int, UIDragScrollView>(); m_soundSlider = FindChildComponent <UISlider>("SoundSlider"); m_soundEffectSlider = FindChildComponent <UISlider>("SoundEffectSlider"); m_doubleClickSlider = FindChildComponent <UISlider>("DoubleClickSlider"); m_settingPanel = FindChildComponent <UIPanel>("SettingPanel"); m_illustratedPanel = FindChildComponent <UIPanel>("IllustratedPanel"); m_soundIcon = FindChildComponent <UISprite>("SoundIcon"); m_girdPanel = FindChildComponent <UIGrid>("ImageGridList"); m_item = FindChildComponent <UIDragScrollView>("ImageGird"); m_sortCardPanel = FindChildComponent <UIPanel>("SortCardPanel"); m_occToggles = FindChildComponent <UITable>("Occupation").gameObject; m_raceToggles = FindChildComponent <UITable>("Race").gameObject; m_OKButton = FindChildComponent <UIButton>("OK").gameObject; m_selectedPanel = FindChild("SelectedPanel"); m_selectedContion = FindChild("SelectedCondition", m_selectedPanel); m_cancelSelect = FindChild("cancel", m_selectedPanel); m_backgroundGrid = FindChild("Grid", m_selectedPanel); m_bg = FindChild("bg", m_selectedPanel); m_changeNamePanel = FindChildComponent <UIPanel>("ChangeNamePanel"); m_userName = FindChildComponent <UIInput>("ChangeNameInput"); m_okChangeButton = FindChildComponent <UIButton>("OKChangeNameButton"); WorldParamInfo worldInfo = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enUnlockHeadImgIconId); IconInfomation iconInfo = GameTable.IconInfoTableAsset.Lookup(worldInfo.IntTypeValue); m_unopen = PoolManager.Singleton.LoadIcon <Texture2D>(iconInfo.dirName); InitIllustratedList(); UpdateIllustratedPanel(); RefreshOccAndRace(); RefreshSelectedCondition(); InitPanelSetting(); }
void InitActor() { int chiefIconID = GameTable.HeroInfoTableAsset.Lookup(ActorManager.Singleton.Chief.IDInTable).headImageId; IconInfomation chiefIconInfo = GameTable.IconInfoTableAsset.Lookup(chiefIconID); m_chiefSprite.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(chiefIconInfo.dirName); // m_chiefButton.normalSprite = chiefIconInfo.SpriteName; if (ActorManager.Singleton.Deputy == null) {//没有副角色,隐藏界面 m_deputyObj.SetActive(false); m_cdObj.SetActive(false); } else { m_deputyObj.SetActive(true); m_cdObj.SetActive(true); int deputyIconID = GameTable.HeroInfoTableAsset.Lookup(ActorManager.Singleton.Deputy.IDInTable).headImageId; IconInfomation deputyIconInfo = GameTable.IconInfoTableAsset.Lookup(deputyIconID); m_deputySprite.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(deputyIconInfo.dirName); // m_deputyButton.normalSprite = deputyIconInfo.SpriteName; m_deputySprite_F.mainTexture = m_deputySprite.mainTexture; } if (ActorManager.Singleton.Chief != null && ActorManager.Singleton.Chief.IsActorExit) { //初始化血条 float scaleHP = ActorManager.Singleton.Chief.HP / ActorManager.Singleton.Chief.MaxHP; m_hpBar.HP = scaleHP; if (ActorManager.Singleton.Deputy != null) { m_headroot.GetComponent <Animation>().Play("ui-switchportrait-00", PlayMode.StopSameLayer); tw_main.PlayForward(); tw_minor.duration = 0.3f; tw_minor.PlayForward(); //初始化血条 scaleHP = ActorManager.Singleton.Deputy.HP / ActorManager.Singleton.Deputy.MaxHP; m_SwitchBarHP.HP = scaleHP; } } m_levelLabel.text = "lv" + ActorManager.Singleton.MainActor.Level.ToString(); }
//设置显示的props void SetPortraitGUID(CSItemGuid guid) { CSItem item = CardBag.Singleton.GetCardByGuid(guid); if (item == null) { return; } HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(item.IDInTable); if (null == heroInfo) { Debug.LogWarning("heroInfo == NULL heroInfo cardID:" + item.IDInTable); return; } IconInfomation iconInfo = GameTable.IconInfoTableAsset.Lookup(heroInfo.headImageId); m_portrait.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); }
public void Update(int floorId) { FloorInfo floorInfo = GameTable.FloorInfoTableAsset.LookUp(floorId); if (null == floorInfo) { return; } m_require.text = Localization.Get("RequireLevel") + floorInfo.m_requireLevel; m_stageName.text = "" + floorInfo.m_name; m_tag.text = floorInfo.m_difficulities; m_cost.text = string.Format(Localization.Get("StaminaCost"), floorInfo.m_cost); IconInfomation iconInfo = GameTable.IconInfoTableAsset.Lookup(floorInfo.m_iconId); if (null != iconInfo) { m_pic.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); } }
//添加非指定素材 void AddUnAppoint(UISprite sprite, FormulaParam param) { Transform texure = sprite.transform.Find("Sprite"); Transform starTexure = sprite.transform.Find("Texture"); WorldParamInfo worldInfo = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enCardDivisionUnAppointIcon); IconInfomation imageInfo = GameTable.IconInfoTableAsset.Lookup(worldInfo.IntTypeValue); texure.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(imageInfo.dirName); Transform label = sprite.transform.Find("MateriaLabel"); int level = param.paramLevel; int occ = param.paramOccu; int star = param.paramRarity; OccupationInfo occTable = GameTable.OccupationInfoAsset.LookUp(occ); if (null == occTable) { return; } label.GetComponent <UILabel>().text = string.Format(Localization.Get("Occupation"), occTable.m_name, level); label.GetComponent <UILabel>().color = Color.red; label.gameObject.SetActive(true); //设置星级图标 RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(star); if (null == rarityInfo) { Debug.Log("RarityRelativeInfo rarityInfo == null info.RarityId:" + star); return; } IconInfomation rarityIcon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId); if (null == rarityIcon) { Debug.Log("IconInfomation rarityIcon == null rarityInfo.m_iconId:" + rarityInfo.m_iconId); return; } starTexure.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(rarityIcon.dirName); starTexure.gameObject.SetActive(true); }
void ShowRepresentativeCardInfo(CSItemGuid guid) { m_RCOption.SetActive(true); CSItem card = CardBag.Singleton.GetCardByGuid(guid); HeroInfo hero = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null == hero) { Debug.LogWarning("null == hero card.IDInTable:" + card.IDInTable); return; } IconInfomation icon = GameTable.IconInfoTableAsset.Lookup(hero.ImageId); RaceInfo race = GameTable.RaceInfoTableAsset.LookUp(hero.Type); OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(hero.Occupation); // 图片 FindChildComponent <UITexture>("CardPic", m_RCOption).mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); GameObject info = FindChild("Info", m_RCOption); FindChildComponent <UILabel>("InfoName", info).text = hero.StrName; FindChildComponent <UILabel>("InfoLevel", info).text = Localization.Get("CardLevel") + card.Level; FindChildComponent <UILabel>("InfoOp", info).text = occupationInfo.m_name; FindChildComponent <UILabel>("InfoHp", info).text = card.GetHp().ToString(); FindChildComponent <UILabel>("InfoMagAttack", info).text = card.GetMagAttack().ToString(); FindChildComponent <UILabel>("InfoPhyAttack", info).text = card.GetPhyAttack().ToString(); FindChildComponent <UILabel>("InfoRace", info).text = race.m_name; RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(hero.Rarity); icon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId); FindChildComponent <UITexture>("InfoRank", info).mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); }
//添加荣誉戒指素材 void AddRingOfHonor(UISprite sprite, FormulaParam param) { Transform texure = sprite.transform.Find("Sprite"); WorldParamInfo worldInfo = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enCardDivisionRingHonorIcon); IconInfomation imageInfo = GameTable.IconInfoTableAsset.Lookup(worldInfo.IntTypeValue); texure.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(imageInfo.dirName); Transform label = sprite.transform.Find("MateriaLabel"); int ringNum = User.Singleton.UserProps.GetProperty_Int32(UserProperty.ring); label.GetComponent <UILabel>().text = string.Format(Localization.Get("WithTheMaterial"), ringNum); if (ringNum < param.paramRingNum) { label.GetComponent <UILabel>().color = Color.red; } else { sprite.GetComponent <Parma>().m_type = 1; label.GetComponent <UILabel>().color = Color.green; } label.gameObject.SetActive(true); }
public void UpDateRepresentativeCard(CSItem item) { Transform transform = this.WindowRoot.transform; Transform playerTransForm = transform.Find("RepresentativeCard"); UILabel cardLevel = playerTransForm.Find("Level").GetComponent <UILabel>(); cardLevel.text = "" + item.Level; UITexture cardHeadSprite = playerTransForm.Find("headPortrait").GetComponent <UITexture>(); int cardID = item.IDInTable; HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(cardID); if (null == heroInfo) { return; } IconInfomation iconInfo = GameTable.IconInfoTableAsset.Lookup(heroInfo.headImageId); if (null == iconInfo) { return; } cardHeadSprite.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); }
// 更新信息 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); }
// 显示二次确认 public void OnShowRUSure() { m_ruSure.gameObject.SetActive(true); int i = 0; bool bShowTips = false; foreach (CSItemGuid slotId in OperateCardList.Singleton.m_sellList) { CSItem card = CardBag.Singleton.GetCardByGuid(slotId); if (null == card) { continue; } HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null == info) { Debug.LogWarning("null == hero card.IDInTable:" + card.IDInTable); continue; } IconInfomation iconInfo = GameTable.IconInfoTableAsset.Lookup(info.headImageId); // 有三星的卡 if (info.Rarity >= 3) { bShowTips = true; } Transform parent = m_grid.transform; if (i >= 5) { parent = m_grid2.transform; } if (false == m_sellImageList.ContainsKey(i)) { // 创建 GameObject copy = GameObject.Instantiate(m_sellItem.gameObject) as GameObject; copy.transform.parent = parent; copy.transform.localScale = m_sellItem.transform.localScale; copy.gameObject.SetActive(true); copy.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); m_sellImageList.Add(i, copy); } else { m_sellImageList[i].GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); m_sellImageList[i].transform.parent = parent; } i++; } List <int> temp = new List <int>(); for (; i < m_sellImageList.Count; i++) { if (m_sellImageList.ContainsKey(i)) { GameObject.Destroy(m_sellImageList[i]); temp.Add(i); } } foreach (int index in temp) { m_sellImageList.Remove(index); } m_grid.Reposition(); m_grid2.Reposition(); // 出售三星以上卡牌提示 m_tips.gameObject.SetActive(bShowTips); }
void UpdateCardInfo(int cardId) { Debug.Log("UpdateCardInfo:" + cardId); m_cardDetail.SetActive(true); HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(cardId); if (null == heroInfo) { return; } Login.Singleton.m_curCardId = cardId; IconInfomation iconInfo = GameTable.IconInfoTableAsset.Lookup(heroInfo.ImageId); m_infoName.text = heroInfo.StrName; RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(heroInfo.Rarity); IconInfomation icon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId); m_star.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); m_cardPic.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); OccupationInfo occInfo = GameTable.OccupationInfoAsset.LookUp(heroInfo.Occupation); RaceInfo raceInfo = GameTable.RaceInfoTableAsset.LookUp(heroInfo.Type); m_infoOp.text = occInfo.m_name; m_ocInfo.text = occInfo.m_name; m_raceInfo.text = raceInfo.m_name; m_ocDetail.text = occInfo.m_describe; int i = 0; List <int> skillIDList = heroInfo.GetAllSkillIDList(); foreach (int skillId in skillIDList) { SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(skillId); if (null == skillInfo || 0 != skillInfo.SkillType) { continue; } iconInfo = GameTable.IconInfoTableAsset.Lookup(skillInfo.Icon); if (iconInfo == null) { Debug.LogWarning("iconInfo 为空 skillId:" + skillId + ",skillInfo.Icon:" + skillInfo.Icon); continue; } if (m_skillList.ContainsKey(skillId)) { GameObject obj = m_skillList[skillId]; obj.SetActive(true); obj.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); Parma parma = obj.GetComponent <Parma>(); parma.m_id = skillId; } else { GameObject copy = GameObject.Instantiate(m_skillItem.gameObject) as GameObject; copy.transform.parent = m_skillParent.transform; copy.transform.localScale = m_skillItem.transform.localScale; copy.gameObject.SetActive(true); copy.transform.LocalPositionX(0 + i * 90f); copy.transform.LocalPositionY(-45f); copy.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); copy.name = copy.name + i; Parma parma = copy.GetComponent <Parma>(); parma.m_id = skillId; EventDelegate.Add(copy.GetComponent <UIEventTrigger>().onPress, OnShowTips); AddChildMouseClickEvent(copy.name, OnHideTips); m_skillList.Add(skillId, copy); } i++; } }
// 更新队伍界面相关信息 public void UpdateInfo() { // 队伍索引 int index = Team.Singleton.m_curTeamIndex; UpdateTeamIndexItem(); Debug.Log("当前队伍索引index:" + index); HideAllModel(); // 允许 最大队伍数量 PlayerAttrInfo playerInfo = GameTable.playerAttrTableAsset.LookUp(User.Singleton.GetLevel()); // if (null != playerInfo && index+1 > playerInfo.m_teamNum) // { // // 显示 要达到的等级 并且重置界面 // m_main.SetActive(false); // m_deputy.SetActive(false); // m_support.SetActive(false); // // m_teamTips.gameObject.SetActive(true); // // m_teamTipsText.text = string.Format(Localization.Get("TeamUnLockLevel"), playerInfo.m_unlockTeamLevel); // return; // } m_left.gameObject.SetActive(true); m_right.gameObject.SetActive(true); if (index == 0) { m_left.gameObject.SetActive(false); } else if (index == Team.Singleton.m_teamList.Count - 1) { m_right.gameObject.SetActive(false); } m_teamNum.GetComponent <UILabel>().text = playerInfo.m_teamNum.ToString(); m_curTeamIndex.GetComponent <UILabel>().text = (index + 1) + ""; m_teamTips.gameObject.SetActive(false); // 实际领导力消耗 int realCost = 0; // 主角色 CSItem card = Team.Singleton.GetCard(index, Team.EDITTYPE.enMain); if (null != card) { // 姓名 HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null == info) { Debug.LogWarning("null == hero card.IDInTable:" + card.IDInTable); } else { m_main.SetActive(true); m_mainLv.GetComponent <UILabel>().text = Localization.Get("CardLevel") + card.Level; AddModel(card, m_mainModel); // 星级 RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity); IconInfomation icon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId); m_mainRank.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); realCost = realCost + info.Cost; OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(info.Occupation); icon = GameTable.IconInfoTableAsset.Lookup(occupationInfo.m_iconId); m_mainOcc.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); m_mainName.GetComponent <UILabel>().text = info.StrName; } } else { m_main.SetActive(false); } // 副角色 card = Team.Singleton.GetCard(index, Team.EDITTYPE.enDeputy); if (null != card) { // 姓名 HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (null == info) { Debug.LogWarning("null == hero card.IDInTable:" + card.IDInTable); } else { m_deputy.SetActive(true); m_deputyLv.GetComponent <UILabel>().text = Localization.Get("CardLevel") + card.Level; AddModel(card, m_deputyModel); // 星级 RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity); IconInfomation icon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId); m_deputyRank.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); realCost = realCost + info.Cost; OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(info.Occupation); icon = GameTable.IconInfoTableAsset.Lookup(occupationInfo.m_iconId); m_deputyOcc.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); m_deputyName.GetComponent <UILabel>().text = info.StrName; } } else { m_deputy.SetActive(false); } // 支持角色 card = Team.Singleton.GetCard(index, Team.EDITTYPE.enSupport); if (null != card) { // 姓名 HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(card.IDInTable); if (info != null) { m_support.SetActive(true); m_supportLv.GetComponent <UILabel>().text = Localization.Get("CardLevel") + card.Level; // 星级 RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity); IconInfomation icon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId); m_supportRank.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); realCost = realCost + info.Cost; AddModel(card, m_supportModel); OccupationInfo occupationInfo = GameTable.OccupationInfoAsset.LookUp(info.Occupation); icon = GameTable.IconInfoTableAsset.Lookup(occupationInfo.m_iconId); m_supportOcc.GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); m_supportName.GetComponent <UILabel>().text = info.StrName; } else { Debug.Log("The info is null: " + card.IDInTable); } } else { m_support.SetActive(false); } // 玩家的领导力 int playerLeadship = User.Singleton.GetLeadership(); // 超过玩家的领导力显示红色 if (realCost > playerLeadship) { m_costText.color = Color.red; } else { m_costText.color = Color.white; } // 领导力 m_costText.text = realCost + "/" + playerLeadship; }
//更新荣誉戒指商店界面 void UpDateRingOfHonorShopUI() { int ring = User.Singleton.UserProps.GetProperty_Int32(UserProperty.ring); int index = 1; foreach (RingOfHonorInfo item in ShopProp.Singleton.m_ringOfHonorList) { UIDragScrollView copy = GameObject.Instantiate(m_ringItem) as UIDragScrollView; copy.GetComponent <Parma>().m_id = item.m_infoId; copy.GetComponent <Parma>().m_type = item.m_cardId; copy.transform.Find("Exchange").GetComponent <UIButton>().transform.Find("RingNum").GetComponent <UILabel>().text = item.m_price.ToString(); //如果戒指数量不足 按钮为灰色 if (ring < item.m_price) { copy.transform.Find("Exchange").GetComponent <UIButton>().enabled = false; } //设置卡牌显示 兑换时间 RingExchangeTableInfo info = GameTable.RingExchangeTableAsset.Lookup(item.m_infoId); UISlider timeSlider = copy.transform.Find("CardDetail").GetComponent <UISlider>().transform.Find("ExchangeTime").GetComponent <UISlider>(); timeSlider.transform.Find("StartTime").GetComponent <UILabel>().text = info.startDate + "~"; timeSlider.transform.Find("EndTime").GetComponent <UILabel>().text = info.endDate; //获得卡牌信息 HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(item.m_cardId); //设置卡牌名字 copy.transform.Find("Attribute").GetComponent <UISlider>().transform.Find("Name").GetComponent <UILabel>().text = heroInfo.StrName; copy.transform.Find("CardDetail").GetComponent <UISlider>().transform.Find("CardNamePanel").transform.Find("Name").GetComponent <UILabel>().text = heroInfo.StrName; //设置种族职业 UISlider typeSlider = copy.transform.Find("Attribute").GetComponent <UISlider>().transform.Find("TypePanel").GetComponent <UISlider>(); typeSlider.transform.Find("Type").GetComponent <UILabel>().text = GameTable.RaceInfoTableAsset.LookUp(heroInfo.Type).m_name; UISlider occupationSlider = copy.transform.Find("Attribute").GetComponent <UISlider>().transform.Find("OccupationPanel").GetComponent <UISlider>(); occupationSlider.transform.Find("Occupation").GetComponent <UILabel>().text = GameTable.OccupationInfoAsset.LookUp(heroInfo.Occupation).m_name; UITexture occupationSprite = occupationSlider.transform.Find("Texture").GetComponent <UITexture>(); //设置职业图标 OccupationInfo occInfo = GameTable.OccupationInfoAsset.LookUp(heroInfo.Occupation); IconInfomation occicon = GameTable.IconInfoTableAsset.Lookup(occInfo.m_iconId); occupationSprite.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(occicon.dirName); //设置星级 UISlider raritySlider = copy.transform.Find("Attribute").GetComponent <UISlider>().transform.Find("RarityPanel").GetComponent <UISlider>(); RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(heroInfo.Rarity); IconInfomation icon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId); raritySlider.transform.Find("Rarity").GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); icon = GameTable.IconInfoTableAsset.Lookup(heroInfo.ImageId); //设置卡牌图片 copy.transform.Find("Attribute").GetComponent <UISlider>().transform.Find("Card").GetComponent <UITexture>().mainTexture = PoolManager.Singleton.LoadIcon <Texture>(icon.dirName); //设置魔法攻击力 UISlider magicSlider = copy.transform.Find("CardDetail").GetComponent <UISlider>().transform.Find("CardNamePanel").transform.Find("MaxMagAttackPanel").GetComponent <UISlider>(); // RarityRelativeInfo rarityRelative = GameTable.RarityRelativeAsset.LookUp(heroInfo.Rarity); magicSlider.transform.Find("MagAttackNum").GetComponent <UILabel>().text = BattleFormula.GetMagAttack(item.m_cardId, 1) + ""; UISlider phySlider = copy.transform.Find("CardDetail").GetComponent <UISlider>().transform.Find("CardNamePanel").transform.Find("MaxPhyAttackPanel").GetComponent <UISlider>(); phySlider.transform.Find("PhyAttackNum").GetComponent <UILabel>().text = BattleFormula.GetPhyAttack(item.m_cardId, 1) + ""; //设置生命值 UISlider hpSlider = copy.transform.Find("CardDetail").GetComponent <UISlider>().transform.Find("CardNamePanel").transform.Find("MaxHpPanel").GetComponent <UISlider>(); hpSlider.transform.Find("MaxHpNum").GetComponent <UILabel>().text = BattleFormula.GetHp(item.m_cardId, 1) + ""; //设置卡牌编号 UILabel cardNum = copy.transform.Find("Attribute").GetComponent <UISlider>().transform.Find("CardNumText").GetComponent <UILabel>(); cardNum.text = string.Format(Localization.Get("MercenaryNum"), heroInfo.CardId); copy.transform.parent = FindChildComponent <UIGrid>("CardGridList").transform; // 设置大小 copy.transform.localScale = m_ringItem.transform.localScale; copy.gameObject.SetActive(true); //设置主动技能 IconInfomation iconInfo = null; SkillInfo skillInfo = null; int skillIndex = 1; List <int> skillIDList = heroInfo.GetAllSkillIDList(); foreach (int skillId in skillIDList) { skillInfo = GameTable.SkillTableAsset.Lookup(skillId); if (0 == skillInfo.SkillType) { UITexture copySkillItem = GameObject.Instantiate(m_skillItem) as UITexture; copySkillItem.GetComponent <Parma>().m_id = skillId; copySkillItem.transform.localScale = m_skillItem.transform.lossyScale; copySkillItem.gameObject.SetActive(true); iconInfo = GameTable.IconInfoTableAsset.Lookup(skillInfo.Icon); copySkillItem.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); copySkillItem.name = copySkillItem.name + skillIndex; copySkillItem.transform.parent = copy.transform.Find("CardDetail").transform.Find("Skill").transform; EventDelegate.Add(copySkillItem.GetComponent <UIEventTrigger>().onPress, OnShowTips); EventDelegate.Add(copySkillItem.GetComponent <UIEventTrigger>().onClick, OnHideTips); //AddChildMouseClickEvent(copySkillItem.name, OnHideTips); } skillIndex++; } m_skillGirdList.Reposition(); //设置被动技能 int passiveIndex = 1; foreach (int skillId in heroInfo.PassiveSkillIDList) { skillInfo = GameTable.SkillTableAsset.Lookup(skillId); if (0 == skillInfo.SkillType) { UISprite copySkillItem = m_skillItem.gameObject.AddComponent <UISprite>(); copySkillItem.GetComponent <Parma>().m_id = skillId; copySkillItem.transform.localScale = m_skillItem.transform.lossyScale; copySkillItem.gameObject.SetActive(true); iconInfo = GameTable.IconInfoTableAsset.Lookup(skillInfo.Icon); copySkillItem.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(iconInfo.dirName); copySkillItem.name = copySkillItem.name + skillIndex; copySkillItem.transform.parent = copy.transform.Find("CardDetail").transform.Find("PassiveSkill").transform; EventDelegate.Add(copySkillItem.GetComponent <UIEventTrigger>().onPress, OnShowTips); EventDelegate.Add(copySkillItem.GetComponent <UIEventTrigger>().onClick, OnHideTips); //AddChildMouseClickEvent(copySkillItem.name, OnHideTips); } passiveIndex++; } m_ringHonorGridList.Add(index, copy); AddMouseClickEvent(copy.transform.Find("Exchange").gameObject, OnBuyRingCardButton); index++; } for (; index < m_ringHonorGridList.Count; index++) { m_ringHonorGridList[index].gameObject.SetActive(false); m_ringHonorGridList[index].GetComponent <Parma>().m_id = 0; m_ringHonorGridList[index].GetComponent <Parma>().m_type = 0; } m_cardGridList.Reposition(); }
public void ShowCard() { if (null == m_showCard) { return; } //设置卡牌头像 HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(m_showCard.IDInTable); if (null == info) { Debug.Log("UICardEvolution HeroInfo == null card.m_id:" + m_showCard.IDInTable); return; } IconInfomation imageInfo = GameTable.IconInfoTableAsset.Lookup(info.ImageId); if (null == imageInfo) { Debug.Log("UICardEvolution IconInfo == null info.ImageId:" + info.ImageId); return; } m_cardHeadImage.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(imageInfo.dirName); //设置星级图标 RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity); if (null == rarityInfo) { Debug.Log("RarityRelativeInfo rarityInfo == null info.RarityId:" + info.Rarity); return; } IconInfomation rarityIcon = GameTable.IconInfoTableAsset.Lookup(rarityInfo.m_iconId); if (null == rarityIcon) { Debug.Log("IconInfomation rarityIcon == null rarityInfo.m_iconId:" + rarityInfo.m_iconId); return; } m_cardStar.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(rarityIcon.dirName); //设置职业图标 OccupationInfo occInfo = GameTable.OccupationInfoAsset.LookUp(info.Occupation); if (null == occInfo) { Debug.Log("OccupationInfo occInfo == null info.Occupation:" + info.Occupation); return; } IconInfomation occIcon = GameTable.IconInfoTableAsset.Lookup(occInfo.m_iconId); if (null == occIcon) { Debug.Log("IconInfomation occIcon == null rarityInfo.m_iconId:" + occInfo.m_iconId); return; } m_cardOcc.mainTexture = PoolManager.Singleton.LoadIcon <Texture>(occIcon.dirName); //是否在编队中 bool isInTeam = Team.Singleton.IsCardInTeam(m_showCard.m_guid); if (isInTeam) { m_cardInfo.gameObject.SetActive(true); m_cardInfo.text = Localization.Get("InTheUseOf"); } //是否是代表卡 if (User.Singleton.RepresentativeCard == m_showCard.m_guid) { m_cardInfo.gameObject.SetActive(true); m_cardInfo.text = Localization.Get("Onbehalfof"); } //是否是最爱 if (m_showCard.Love) { m_cardLove.gameObject.SetActive(true); } // 是否是新卡 m_new.gameObject.SetActive(m_bNew); }