private void CreateSkillItem(UDSkill.Skill skill, Transform parent) { var go = Object.Instantiate(skillItem); go.transform.SetParent(parent); go.transform.localScale = Vector3.one; go.SetActive(true); UISkillItem item = new UISkillItem(go.transform); item.Refresh(skill); //add click btn go.AddComponent <Button>().AddListener(() => ShowDesc(item)); }
private void CreateSkillItem(UDSkill.Skill skill) { GameObject go = GameObject.Instantiate(skillItem) as GameObject; go.transform.SetParent(skillItem.transform.parent); go.transform.localScale = Vector3.one; go.SetActive(true); UISkillItem item = go.AddComponent <UISkillItem>(); item.Refresh(skill); skillItems.Add(item); //add click btn go.AddComponent <Button>().onClick.AddListener(OnClickSkillItem); }
private void OnClickUpgrade() { currentItem.data.level++; currentItem.Refresh(currentItem.data); RefreshDesc(currentItem); }