Exemple #1
0
    public void Paint(Vector2 position, bool isPlayerPainted)
    {
        ChangeMaterial change = GameManager.GM.gameField[position].cellObject.GetComponent <ChangeMaterial>();

        GameManager.GM.gameField[position].cellObject.transform.GetComponent <MeshRenderer>().enabled = false;

        if (isPlayerPainted)
        {
            if (!change.cellPaintedByPlayer.activeSelf)
            {
                countOfPaintedPlayerCells++;
                change.ChangeToPlayerColor();
            }
        }
        else
        {
            if (!change.cellPaintedByOther.activeSelf)
            {
                countOfPaintedOtherCells++;
                change.ChangeToOtherColor();
            }
        }
    }