Example #1
0
    /// <summary>
    ///   Change to next Hero.
    /// </summary>
    public static void ChangeHero()
    {
        HeroStrong heroStrong = InputManager.Instance.heroStrong;
        HeroFast   heroFast   = InputManager.Instance.heroFast;

        Hero hero = GetActiveHero();

        if (hero == null)
        {
            DisableControlAll();
            lastActiveHero._OnFocus();
        }
        else if (hero.Equals(heroStrong))
        {
            heroStrong._OnFocusOut();
            heroFast._OnFocus();
            lastActiveHero = heroFast;
        }
        else if (hero.Equals(heroFast))
        {
            heroFast._OnFocusOut();
            heroStrong._OnFocus();
            lastActiveHero = heroStrong;
        }
        else
        {
            DisableControlAll();
            heroStrong._OnFocus();
            lastActiveHero = heroStrong;
        }
        SoundManager.Instance.SendMessage("PlaySFXSwap");
    }