Ejemplo n.º 1
0
        public static SkillDesButton Get(GameObject go)
        {
            SkillDesButton btn = go.GetComponent <SkillDesButton>();

            if (btn == null)
            {
                btn = go.AddComponent <SkillDesButton>();
            }
            btn.GetLuaSkillDesButton();
            return(btn);
        }
Ejemplo n.º 2
0
 public void Set(string title, List <SkillInfo> skillList)
 {
     textTitle.text = title;
     for (int i = 0, count = skillList.Count; i < count; i++)
     {
         Image img = Instantiate <Image>(skillPrefab);
         img.SetSprite(ResMgr.instance.Load <Sprite>(ResPath.GetSkillIconPath(skillList[i].skillData.skillIcon)));
         img.transform.SetParent(skillRoot, false);
         SkillDesButton skillBtn = img.gameObject.AddComponent <SkillDesButton>();
         skillBtn.SetSkillInfo(skillList[i], 0, 0);
         Image  combo = img.transform.Find("combo").GetComponent <Image>();
         Sprite sp    = ResMgr.instance.LoadSprite(Skill.SkillUtil.GetDesTypeIcon(skillList[i].skillData));
         if (sp != null)
         {
             combo.SetSprite(sp);
         }
         else
         {
             combo.gameObject.SetActive(false);
         }
     }
     skillPrefab.gameObject.SetActive(false);
 }