void AddSkillCell(SkillData skillData, int index) { GameObject o = NGUITools.AddChild(skillGrid.gameObject, skillCellPrefab); o.name = index.ToString() + " " + skillData.skillID; UISkillCell skillcell = o.GetComponent <UISkillCell>(); skillcell.SetData(skillData, this); }
void UpdateAllSkillState() { foreach (Transform t in skillGrid.transform) { UISkillCell skillcell = t.GetComponent <UISkillCell>(); int skillRank = PlayerInfo.Instance.GetSkillLevel(skillcell.skillData.skillID); skillcell.Unlocked = (skillRank == 0); skillcell.UpdateFlagState(); } }