Пример #1
0
    // This function ends the current player turn and starts the opposing player turn.
    public void EndTurn()
    {
        object[] tiles = GameObject.FindGameObjectsWithTag("Tile");
        movementManager.ClearHighlights(tiles);
        prevPiece = null;

        if (isPlayer1Turn == true)
        {
            isPlayer1Turn = false;
            hunterButtonPlayer1.gameObject.SetActive(false);
            archerButtonPlayer1.gameObject.SetActive(false);
            dragonButtonPlayer1.gameObject.SetActive(false);
            endTurnPlayer1.gameObject.SetActive(false);

            hunterButtonPlayer2.gameObject.SetActive(true);
            archerButtonPlayer2.gameObject.SetActive(true);
            dragonButtonPlayer2.gameObject.SetActive(true);
            endTurnPlayer2.gameObject.SetActive(true);
        }
        else
        {
            isPlayer1Turn = true;
            hunterButtonPlayer1.gameObject.SetActive(true);
            archerButtonPlayer1.gameObject.SetActive(true);
            dragonButtonPlayer1.gameObject.SetActive(true);
            endTurnPlayer1.gameObject.SetActive(true);

            hunterButtonPlayer2.gameObject.SetActive(false);
            archerButtonPlayer2.gameObject.SetActive(false);
            dragonButtonPlayer2.gameObject.SetActive(false);
            endTurnPlayer2.gameObject.SetActive(false);
        }
        colourManager.ManageColours(isPlayer1Turn);
    }