Ejemplo n.º 1
0
 void _OnMenuStateChange(MenuStateChanged e)
 {
     if (e.state == MenuState.AnimatingAttack)
     {
         transform.GetChild(0).gameObject.SetActive(false);
         transform.GetChild(1).gameObject.SetActive(false);
     }
     else
     {
         transform.GetChild(0).gameObject.SetActive(true);
         transform.GetChild(1).gameObject.SetActive(true);
     }
 }
Ejemplo n.º 2
0
    // EVENT LISTENERS

    public void _OnMenuStateChange(MenuStateChanged e)
    {
        if (e.state == currMenu)
        {
            return;
        }

        switch (e.state)
        {
        case MenuState.NonUIPlayerPlaying:
            currMenu = MenuState.NonUIPlayerPlaying;
            DoSwap(currMenuObj, nonUIPlayerPlaying);
            break;

        case MenuState.BuyPhaseMenu:
            currMenu = MenuState.BuyPhaseMenu;
            StartCoroutine(DoSwapAnimation(currMenuObj, buyPhaseMenu));
            break;

        case MenuState.BuyMenu:
            currMenu = MenuState.BuyMenu;
            StartCoroutine(DoSwapAnimation(currMenuObj, buyMenu));
            break;

        case MenuState.ActionPhaseMenu:
            currMenu = MenuState.ActionPhaseMenu;
            StartCoroutine(DoSwapAnimation(currMenuObj, actionPhaseMenu));
            break;

        case MenuState.UseMenu:
            currMenu = MenuState.UseMenu;
            StartCoroutine(DoSwapAnimation(currMenuObj, useMenu));
            break;

        case MenuState.UpgradeMenu:
            currMenu = MenuState.UpgradeMenu;
            StartCoroutine(DoSwapAnimation(currMenuObj, upgradeMenu));
            break;

        case MenuState.AttackPhaseMenu:
            currMenu = MenuState.AttackPhaseMenu;
            StartCoroutine(DoSwapAnimation(currMenuObj, attackPhaseMenu));
            break;

        case MenuState.AnimatingAttack:
            currMenu = MenuState.AnimatingAttack;
            StartCoroutine(DoSwapOutPopInAnimation(currMenuObj, animateAttackWindow));
            break;
        }
    }