Exemple #1
0
    /**
     * active panel to block dawn panel during the ringmaster turn
     * OR to prevent use card when it's forbidden
     */
    public void DownPanelBlock(bool isPanelBlock)
    {
        AreButtonLock = isPanelBlock;

        downPanelBlock.SetActive(isPanelBlock);
        handManager.HandUpdate();

        //Cards in hand become darker if the block is activated, normal if not
        if (isPanelBlock)
        {
            Color blockColor = new Color(0.5f, 0.5f, 0.5f, 1);
            foreach (CardDisplay card in handManager.GetCardsInHand())
            {
                Transform _cardTemplate = card.transform.GetChild(0).GetChild(0);
                if (_cardTemplate.name == "Template")
                {
                    _cardTemplate.GetComponent <Image>().color = blockColor;
                }
            }
        }
        else
        {
            Color normalColor = new Color(1, 1, 1, 1);
            foreach (CardDisplay card in handManager.GetCardsInHand())
            {
                Transform _cardTemplate = card.transform.GetChild(0).GetChild(0);
                if (_cardTemplate.name == "Template")
                {
                    _cardTemplate.GetComponent <Image>().color = normalColor;
                }
            }
        }
    }