Exemplo n.º 1
0
 public override void ReceiveClosedWindowNotification()
 {
     //Debug.Log("SkillTrainerUI.OnCloseWindow()");
     base.ReceiveClosedWindowNotification();
     DeactivateButtons();
     selectedSkillTrainerSkillScript = null;
 }
Exemplo n.º 2
0
 public void LearnSkill()
 {
     //Debug.Log("SkillTrainerUI.LearnSkill()");
     if (currentSkill != null)
     {
         //if (MySelectedSkillTrainerSkillScript != null && MySelectedSkillTrainerSkillScript.MySkillName != null) {
         playerManager.MyCharacter.CharacterSkillManager.LearnSkill(selectedSkillTrainerSkillScript.Skill);
         //UpdateButtons(MySelectedSkillTrainerSkillScript.MySkillName);
         selectedSkillTrainerSkillScript = null;
         ClearDescription();
         ShowSkills();
     }
 }
Exemplo n.º 3
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]);
        }
Exemplo n.º 4
0
 public void SetSelectedButton(SkillTrainerSkillScript selectedSkillTrainerSkillScript)
 {
     this.selectedSkillTrainerSkillScript = selectedSkillTrainerSkillScript;
     ShowDescription(selectedSkillTrainerSkillScript.Skill);
 }