Beispiel #1
0
    /// <summary>
    /// Shuffles the game field
    /// Called, if no more moves are possible
    /// </summary>
    public void ShuffleShapes()
    {
        ShuffleCanvas.gameObject.SetActive(false);

        shapes.Shuffle();

        for (int row = 0; row < Variables.Rows; row++)
        {
            for (int column = 0; column < Variables.Columns; column++)
            {
                shapes[row, column].transform.position = BottomRight + new Vector2(column * CandySize.x, row * CandySize.y);
            }
        }

        StartCoroutine(FindMatchesAndCollapse());
    }