Пример #1
0
    void SelectCard()
    {
        if (gamepad.GetButtonDown(attack))
        {
            if (selectedCard != null)
            {
                selectedCard.Deselect();
            }

            if (selectedCard != null && selectedCard.cardNature == Cards.Attack)
            {
                selectedCard = null;
            }

            else
            {
                selectedCard = cardDico[Cards.Attack];
                selectedCard.Select();
            }
        }

        if (gamepad.GetButtonDown(shield))
        {
            if (selectedCard != null)
            {
                selectedCard.Deselect();
            }

            if (selectedCard != null && selectedCard.cardNature == Cards.Shield)
            {
                selectedCard = null;
            }

            else
            {
                selectedCard = cardDico[Cards.Shield];
                selectedCard.Select();
            }
        }

        if (gamepad.GetButtonDown(backstep))
        {
            if (selectedCard != null)
            {
                selectedCard.Deselect();
            }

            if (selectedCard != null && selectedCard.cardNature == Cards.Backstep)
            {
                selectedCard = null;
            }

            else
            {
                selectedCard = cardDico[Cards.Backstep];
                selectedCard.Select();
            }
        }
    }