コード例 #1
0
    public void ShowCurrentTurn(PawnColor turn, string name)
    {
        //HideDiceImage ();
        rolledDiceNumber.gameObject.SetActive(false);
        switch (turn)
        {
        case PawnColor.c_Blue:
            showTurn.text  = (name == null || name == "") ? "Blues Turn" : name + "'s Turn";
            showTurn.color = blue;
            Blue.ShowSelectableAnimation();
            Red.StopSelectableAnimation();
            Yellow.StopSelectableAnimation();
            Green.StopSelectableAnimation();
            //diceValImage.GetComponent<Image> ().color = Color.blue;
            rolledDiceNumber.color = Color.blue;
            break;

        case PawnColor.c_Red:
            showTurn.text  = (name == null || name == "") ? "Reds Turn" : name + "'s Turn";
            showTurn.color = red;
            Blue.StopSelectableAnimation();
            Red.ShowSelectableAnimation();
            Yellow.StopSelectableAnimation();
            Green.StopSelectableAnimation();
            //diceValImage.GetComponent<Image> ().color = Color.red;
            rolledDiceNumber.color = Color.red;
            break;

        case PawnColor.c_Yellow:
            showTurn.text  = (name == null || name == "") ? "Yellows Turn" : name + "'s Turn";
            showTurn.color = yellow;
            Blue.StopSelectableAnimation();
            Red.StopSelectableAnimation();
            Yellow.ShowSelectableAnimation();
            Green.StopSelectableAnimation();
            //diceValImage.GetComponent<Image> ().color = Color.yellow;
            rolledDiceNumber.color = Color.yellow;
            break;

        case PawnColor.c_Green:
            showTurn.text  = (name == null || name == "") ? "Greens Turn" : name + "'s Turn";
            showTurn.color = green;
            Blue.StopSelectableAnimation();
            Red.StopSelectableAnimation();
            Yellow.StopSelectableAnimation();
            Green.ShowSelectableAnimation();
            //diceValImage.GetComponent<Image> ().color = Color.green;
            rolledDiceNumber.color = Color.green;
            break;
        }

        turnColorIndicator.color = rolledDiceNumber.color;
    }