示例#1
0
 public static void SelectArmy(Army sel)
 {
     army = sel;
     army.Selected(true);
     ArmyPanel.Show(true);
     DeselectShip();
 }
示例#2
0
 public static void DeselectArmy()
 {
     army?.Selected(false);
     army = null;
     if (CastingSkill)
     {
         StopCastSkill();
     }
     ArmyPanel.Show(false);
 }
示例#3
0
    public static void Show(bool show)
    {
        curArmy = Player.army == null? curArmy : Player.army;

        show &= curArmy != null;
        Instance.gameObject.SetActive(show);

        if (curArmy)
        {
            Instance.Person = curArmy.Person;
            MenuManager.CheckExchangeRegiment();
            if (show)
            {
                Instance.Show();
                curArmy.HitAction              += Instance.UpdateArmy;
                curArmy.ArmyListChange         += Instance.UpdateArmy;
                curArmy.Person.ExpChanged      += Instance.UpdatePropertyAndSkills;
                curArmy.Person.SkillCulldowned += Instance.UpdatePropertyAndSkills;
            }
            else
            {
                curArmy.HitAction              -= Instance.UpdateArmy;
                curArmy.ArmyListChange         -= Instance.UpdateArmy;
                curArmy.Person.ExpChanged      -= Instance.UpdatePropertyAndSkills;
                curArmy.Person.SkillCulldowned -= Instance.UpdatePropertyAndSkills;
            }
            for (int i = 0; i < curArmy.Person.Skills.Length; i++)
            {
                if (show)
                {
                    curArmy.Person.Skills[i].ButtonUpdate += Instance.skillsButton[i].UpdateState;
                }
                else
                {
                    curArmy.Person.Skills[i].ButtonUpdate -= Instance.skillsButton[i].UpdateState;
                }
            }
        }
    }