/// <summary> /// 设置各英雄技能 /// </summary> /// <param name="charDatas">英雄</param> private void SetSkillButton(FightHeroList heroList) { UIBtnBattleSkill btnSkill; //Debug.Log("-------------" + heroList.getFightHeroDict().Count); for (int i = 0; i < heroList.getFightHeroDict().Count; i++) { List<UIBtnBattleSkill> listSkill = new List<UIBtnBattleSkill>(); HeroData hData = heroList.getHeroData(i); if (hData == null) continue; bool isActive = i == 0; for (int j = 0; j < GlobalDef.MAX_USE_SKILL; j++) { //SkillItem skill = hData.skillList.getUseSkillByIdx(j); //Debug.Log(charDatas[i].m_skillIds[j]); btnSkill = KMTools.AddChild<UIBtnBattleSkill>(grdSkill.gameObject, prbBtnSkill, true); // set active: btnSkill.gameObject.SetActive(isActive); btnSkill.Init(this, hData.skillList.getUseSkillByIdx(j)); listSkill.Add(btnSkill); } //Debug.Log(" -----tempid" + hData.templateID); skillDir.Add(hData.templateID, listSkill); //Debug.Log(" add =======================" + heroList.getHeroData(i).templateID); } //Debug.Log("set skill complete : and count is " + skillDir.Count); grdSkill.repositionNow = true; prbBtnSkill.gameObject.SetActive(false); if(curHero != null) ChangeCharSkills(curHero.templateID); }