Esempio n. 1
0
        public void RemoveDisableSkillItem()
        {
            List <SkillItemView> list = new List <SkillItemView>();

            for (int i = 0, count = _sorts.Count; i < count; i++)
            {
                SkillItemView skillItemView = _sorts[i];
                if (skillItemView)
                {
                    if (!skillItemView.Enable)
                    {
                        skillItemView.Sort = 0;
                        list.Add(skillItemView);
                    }
                }
            }
            for (int i = 0, count = list.Count; i < count; i++)
            {
                _sorts.Remove(list[i]);
            }
            for (int i = 0, count = _sorts.Count; i < count; i++)
            {
                SkillItemView skillItemView = _sorts[i];
                if (skillItemView)
                {
                    skillItemView.Sort = i + 1;
                }
            }
        }
Esempio n. 2
0
 private void RemoveSkillItem(uint skillId)
 {
     RemoveDisableSkillItem();
     for (int i = 0, count = _sorts.Count; i < count; i++)
     {
         SkillItemView skillItemView = _sorts[i];
         if (skillItemView)
         {
             if (skillItemView.skillID == skillId)
             {
                 skillItemView.Sort = 0;
                 _sorts.Remove(skillItemView);
                 break;
             }
         }
     }
     for (int i = 0, count = _sorts.Count; i < count; i++)
     {
         SkillItemView skillItemView = _sorts[i];
         if (skillItemView)
         {
             skillItemView.Sort = i + 1;
         }
     }
 }
Esempio n. 3
0
 public void OrderPlayerSkill(uint id, SkillItemView skillItemView)
 {
     if (Fight.Controller.FightController.instance.fightStatus == FightStatus.Normal)
     {
         AddSkillItem(skillItemView);
     }
     Fight.Controller.FightController.instance.OrderPlayerSkill(id, skillItemView.skillID, false);
 }
Esempio n. 4
0
        private void AddSkillItem(SkillItemView skillItemView)
        {
            RemoveDisableSkillItem();
            int sort = _sorts.Count + 1;

            skillItemView.Sort = sort;
            _sorts.Add(skillItemView);
        }
Esempio n. 5
0
    public void SelectSkill(SkillItemView vv)
    {
        if (selectedSkill != -1)
        {
            view.SkillViewList[selectedSkill].Unselect();
        }
        if (vv == null)
        {
            selectedSkill = -1;
            return;
        }
        selectedSkill = view.SkillViewList.IndexOf(vv);
        vv.Select();

        ShowDetail(model.NowSkills[selectedSkill]);

        //UpdateDetailPanel(model.Choosavles[selectSchedule]);
    }
Esempio n. 6
0
    public void SwitchChoose(int newTab)
    {
        if (newTab == -1 || model.nowTab == newTab)
        {
            return;
        }


        model.nowTab = newTab;


        for (int i = 0; i < view.TypeTabGroup.tabs.Count; i++)
        {
            CardsTabView childView = view.TypeTabGroup.tabs[i] as CardsTabView;
            childView.BG.color = Color.white;
        }
        {
            CardsTabView childView = view.TypeTabGroup.tabs[newTab] as CardsTabView;
            childView.BG.color = Color.red;
        }

        List <string> skills = new List <string>();

        if (newTab == 0)
        {
            skills = pSkillMgr.GetSkillByType("common");
        }
        else if (newTab == 1)
        {
            skills = pSkillMgr.GetSkillByType("quality");
        }
        else if (newTab == 2)
        {
            skills = pSkillMgr.GetSkillByType("caiyi");
        }
        else if (newTab == 3)
        {
            skills = pSkillMgr.GetSkillByType("game");
        }
        model.NowSkills = skills;
        foreach (SkillItemView vv in view.SkillViewList)
        {
            resLoader.ReleaseGO("UI/Schedule/ScheduleItem", vv.root.gameObject);
        }
        view.SkillViewList.Clear();


        foreach (string sid in skills)
        {
            SkillAsset sa = pSkillMgr.GetSkillAsset(sid);

            GameObject    go = resLoader.Instantiate("UI/Schedule/ScheduleItem", view.ChoicesContainer);
            SkillItemView vv = new SkillItemView();
            vv.BindView(go.transform);
            vv.Title.text = sa.SkillName;
            view.SkillViewList.Add(vv);
            vv.Unselect();

            ClickEventListerner listener = vv.Icon.gameObject.GetComponent <ClickEventListerner>();
            if (listener == null)
            {
                listener = vv.Icon.gameObject.AddComponent <ClickEventListerner>();
            }
            listener.ClearClickEvent();
            listener.OnClickEvent += delegate {
                SelectSkill(vv);
            };
        }

        HideDetail();
    }