Example #1
0
        private void SkillsChanged(App.Model.MSkill[] oldvalue, App.Model.MSkill[] newvalue)
        {
            Debug.LogError("SkillsChanged run");
            App.Util.Global.ClearChild(skillContent.gameObject);

            this.Controller.ScrollViewSets(skillContent, skillChild, newvalue);
            App.Model.Master.MCharacterSkill[] skills = CharacterCacher.Instance.Get(ViewModel.CharacterId.Value).skills;
            foreach (App.Model.Master.MCharacterSkill skill in skills)
            {
                if (System.Array.Exists(ViewModel.Skills.Value, s => s.SkillId == skill.skill_id))
                {
                    continue;
                }
                App.Model.MSkill mSkill = new App.Model.MSkill();
                mSkill.SkillId   = skill.skill_id;
                mSkill.CanUnlock = skill.star <= ViewModel.Star.Value;
                this.Controller.ScrollViewSetChild(skillContent, skillChild, mSkill);
            }
            int skillCount = skillContent.childCount;

            for (int i = skillCount; i < 5; i++)
            {
                App.Model.MSkill mSkill = new App.Model.MSkill();
                this.Controller.ScrollViewSetChild(skillContent, skillChild, mSkill);
            }
        }
Example #2
0
 private void CurrentSkillChanged(App.Model.MSkill oldvalue, App.Model.MSkill newvalue)
 {
     if (newvalue == null)
     {
         skillname.text = "--";
     }
     else
     {
         skillname.text = newvalue.Master.name;
     }
 }