Ejemplo n.º 1
0
        public void ShowSkillsCommon(SkillTrainerComponent skillTrainer)
        {
            //Debug.Log("SkillTrainerUI.ShowSkillsCommon(" + skillTrainer.name + ")");

            ClearSkills();

            SkillTrainerSkillScript firstAvailableSkill = null;

            foreach (Skill skill in skillTrainer.Props.Skills)
            {
                if (!playerManager.MyCharacter.CharacterSkillManager.HasSkill(skill))
                {
                    GameObject go = objectPooler.GetPooledObject(skillPrefab, availableArea.transform);
                    SkillTrainerSkillScript qs = go.GetComponent <SkillTrainerSkillScript>();
                    qs.Configure(systemGameManager);
                    qs.Text.text  = skill.DisplayName;
                    qs.Text.color = Color.white;
                    qs.SetSkill(this, skill);
                    skillScripts.Add(qs);
                    skills.Add(skill);
                    uINavigationControllers[0].AddActiveButton(qs);
                    if (firstAvailableSkill == null)
                    {
                        firstAvailableSkill = qs;
                    }
                }
            }

            if (firstAvailableSkill == null)
            {
                // no available skills anymore, close window
                uIManager.skillTrainerWindow.CloseWindow();
            }

            if (selectedSkillTrainerSkillScript == null && firstAvailableSkill != null)
            {
                //firstAvailableSkill.Select();
                uINavigationControllers[0].FocusFirstButton();
            }
            SetNavigationController(uINavigationControllers[0]);
        }
Ejemplo n.º 2
0
 public void ShowSkills(SkillTrainerComponent skillTrainer)
 {
     //Debug.Log("SkillTrainerUI.ShowSkills(" + skillTrainer.name + ")");
     this.skillTrainer = skillTrainer;
     ShowSkillsCommon(this.skillTrainer);
 }