コード例 #1
0
    public void OnSpecialSelected()
    {
        EnableAllButtons(false);

        switch (currentTurn)
        {
        case Turn.PALADIN:
        {
            if (paladinController.GetSpecial() == 5)
            {
                special1ButtonImage.enabled = false;
                special1ButtonText.enabled  = false;
                special1Button.interactable = false;
                paladinController.OnSpecial();
                stateText.text = "JUDGEMENT";
            }
            else
            {
                paladinController.StartCoroutine(paladinController.OnNotEnoughSpecial());
                EnableAllButtons(true);
            }
        }
        break;

        case Turn.VALKYRIE:
        {
            if (valkyrieController.GetSpecial() == 5)
            {
                special1ButtonImage.enabled = false;
                special1ButtonText.enabled  = false;
                special1Button.interactable = false;
                valkyrieController.OnSpecial();
                stateText.text = "FALLING STARS";
            }
            else
            {
                valkyrieController.StartCoroutine(valkyrieController.OnNotEnoughSpecial());
                EnableAllButtons(true);
            }
        }
        break;

        case Turn.SAGE:
        {
            if (sageController.GetSpecial() == 5)
            {
                special1ButtonImage.enabled = false;
                special1ButtonText.enabled  = false;
                special1Button.interactable = false;
                sageController.OnSpecial();
                stateText.text = "FOREST CALLING";
            }
            else
            {
                valkyrieController.StartCoroutine(valkyrieController.OnNotEnoughSpecial());
                EnableAllButtons(true);
            }
        }
        break;
        }
    }