Example #1
0
    public void PopulateDevelopmentSkills()
    {
        GameObject developmentSkillPrefab = DevelopmentSkillsCatalog.instance.developmentSkillPrefab;

        foreach (Transform child in developedSkillsParent)
        {
            Destroy(child.gameObject);
        }

        foreach (string devSkill in GetSelectedSkills())
        {
            DevelopmentSkillObject devObject = DevelopmentSkillsCatalog.instance.GetDevelopmentSkill(devSkill);
            if (devObject != null)
            {
                GameObject        newGameObj = Instantiate(developmentSkillPrefab, Vector3.zero, Quaternion.identity, developedSkillsParent);
                DevelopmentSkills devSk      = newGameObj.GetComponentInChildren <DevelopmentSkills>();
                // newGameObj.GetComponent<Image>().SetNativeSize();
                devSk.SetSkill(devObject);
            }
            else
            {
                Debug.Log(devSkill + ": Development Skills Object NULL");
            }
        }
    }
Example #2
0
 public void SetSkill(DevelopmentSkillObject devObject)
 {
     this.title.text   = devObject.title;
     this.image.sprite = devObject.image;
 }