// 记录 技能相关信息 void SetOldSkillData() { CSItem card = CardBag.Singleton.GetCardByGuid(m_curLevelGuid); if (null == card) { return; } m_skillDataList.Clear(); foreach (var item in card.SkillItemInfoList) { SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(item.m_skillID); if (skillInfo == null) { continue; } // 如果是解锁技能 if (card.HaveSkill(item.m_skillID)) { m_skillDataList.Add(item.m_skillID, item.m_skillLevel); } } }
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 SkillLevelUp() { CSItem card = CardBag.Singleton.GetCardByGuid(m_curLevelGuid); if (null == card) { return; } LevelUp.Singleton.m_curState = LevelUp.LevelState.enCardUpdate; LevelUp.Singleton.ClearSkillList(); foreach (var item in card.SkillItemInfoList) { SkillInfo skillInfo = GameTable.SkillTableAsset.Lookup(item.m_skillID); if (skillInfo == null) { continue; } // 如果是解锁技能 if (card.HaveSkill(item.m_skillID)) { // 如果记录中的 等级和 最新等级不一样则 为升级 if (m_skillDataList.ContainsKey(item.m_skillID)) { if (item.m_skillLevel > m_skillDataList[item.m_skillID]) { SkillLevelUpInfo info = new SkillLevelUpInfo(); info.m_skillId = item.m_skillID; info.m_skillLevel = item.m_skillLevel; LevelUp.Singleton.m_skillList.Add(info); UnityEngine.Debug.Log("chief SkillID :" + item.m_skillID + "Level up " + item.m_skillLevel); } } } } LevelUp.Singleton.ShowSkill(); }
// 更新TIPS 信息 void UpdateTipsInfo(int skillId) { CSItem card = null; if (CardBag.Singleton.m_curOptinGuid.Equals(CSItemGuid.Zero)) { card = CardBag.Singleton.m_cardForDetail; } else { card = CardBag.Singleton.itemBag.GetItemByGuid(CardBag.Singleton.m_curOptinGuid); } if (null == card) { return; } HeroInfo heroInfo = GameTable.HeroInfoTableAsset.Lookup(card.m_id); if (null == heroInfo) { return; } SkillInfo info = GameTable.SkillTableAsset.Lookup(skillId); if (null == info) { return; } HeroCardSkill heroSkillInfo = card.GetSkillInfo(skillId); CDInfo cdInfo = GameTable.CDTableAsset.Lookup(info.CoolDown); if (cdInfo == null) { m_tipsSkillCD.text = GetTimeString(0f); } else { m_tipsSkillCD.text = GetTimeString(cdInfo.CDTime); } // Debug.Log("m_tipsSkillDes:" + m_tipsSkillDes.height); int needLevel = 0; // tips 位置 int offset = 50; needLevel = heroInfo.GetSkillNeedLevel(skillId); // 主动技能类型 if (info.SkillType == (int)ENSkillType.enSkill) { offset = 100; } else { offset = 200; } // 是否有此技能 if (!card.HaveSkill(skillId)) { m_skillGetTips.text = string.Format(Localization.Get("SkillUnlockLevel"), needLevel); m_skillGetTips.gameObject.SetActive(true); } else { m_skillGetTips.gameObject.SetActive(false); } // 设置内容 m_tipsSkillName.text = info.Name; m_tipsSkillDes.text = info.Description; m_tipsSkillLevel.text = heroSkillInfo.m_skillLevel.ToString(); int height = 100; height = height + m_tipsSkillDes.height; int switchTipsHeight = 100; switchTipsHeight = switchTipsHeight + m_tipsSkillDes.height; m_comboItem.SetActive(false); for (int i = 0; i < m_comboList.Count; i++) { if (null != m_comboList[i]) { GameObject.Destroy(m_comboList[i]); } } string strSkillType = ""; // 终结技 if (info.SkillConnectionType == (int)ENSkillConnectionType.enFinal) { strSkillType = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enFinalSkill).StringTypeValue; m_comboItem.SetActive(true); int minCombo = info.MinComboRequir + (int)(info.ComboRequirementParam * heroSkillInfo.m_skillLevel); m_comboItem.GetComponent <UILabel>().text = minCombo.ToString(); WorldParamInfo worldInfo = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enActiveSkill); m_comboItem.transform.Find("ComboDes").GetComponent <UILabel>().text = Localization.Get(worldInfo.StringTypeValue); height = height + 60; Dictionary <int, string> list = GetComboList(skillId); int comboMax = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enMaxCombo).IntTypeValue; if (list != null) { int i = 1; foreach (KeyValuePair <int, string> item in list) { if (i >= comboMax) { break; } GameObject copy = GameObject.Instantiate(m_comboItem) as GameObject; copy.SetActive(true); copy.transform.parent = m_switchSkillTips.transform; copy.name = copy.name + i; copy.transform.localScale = Vector3.one; copy.transform.localPosition = Vector3.zero; copy.GetComponent <UILabel>().text = item.Key.ToString(); copy.transform.Find("ComboDes").GetComponent <UILabel>().text = item.Value; height = height + 60; i++; m_comboList.Add(copy); } } } else if (info.SkillConnectionType == (int)ENSkillConnectionType.enConnect) { strSkillType = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enConectSkill).StringTypeValue; } else if (info.SkillConnectionType == (int)ENSkillConnectionType.enSpecial) { strSkillType = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enSpecialSkill).StringTypeValue; } m_tipsSkillType.GetComponent <UILabel>().text = Localization.Get(strSkillType); // 设置tips的 大小 主要是高度 m_tips.GetComponent <UISprite>().height = height; // 设置位置 m_tips.GetComponent <UISprite>().topAnchor.absolute = -offset; m_switchSkillTips.GetComponent <UILabel>().topAnchor.absolute = -switchTipsHeight; m_switchSkillTips.GetComponent <UIGrid>().Reposition(); }