Пример #1
0
    private void RunSkill(string button, PlayerSkill skill)
    {
        if (skill != null)
        {
            if (Input.GetButtonDown(button))
            {
                skill.Press();

                for (int i = 0; i < m_skills.Count; i++)
                {
                    PlayerSkill attack = m_skills[i].AttackSkill;
                    if (attack != skill && !attack.IsFinished)
                    {
                        attack.Interrupt(skill);
                    }

                    PlayerSkill dash = m_skills[i].DashSkill;
                    if (dash != skill && !dash.IsFinished)
                    {
                        dash.Interrupt(skill);
                    }
                }
            }
            else if (Input.GetButton(button))
            {
                skill.Hold();
            }
            else if (Input.GetButtonUp(button))
            {
                skill.Release();
            }
        }
    }