コード例 #1
0
ファイル: Grid.cs プロジェクト: harrivin/Boggle_Game
    private void BuildSuffledIndexes()
    {
        tiles     = new List <Tile> ();
        gridTiles = new List <List <Tile> > ();

        gridIndexes = new List <Cell> ();
        Cell indexer;

        for (int column = 0; column < COLUMNS; column++)
        {
            var columnTiles = new List <Tile>();

            for (int row = 0; row < ROWS; row++)
            {
                indexer        = new Cell();
                indexer.column = column;
                indexer.row    = row;
                gridIndexes.Add(indexer);

                var item = Instantiate(gridTileGO) as GameObject;
                var tile = item.GetComponent <Tile>();
                tile.SetTilePosition(this, column, row);
                tile.transform.parent = gameObject.transform;
                tiles.Add(tile);
                columnTiles.Add(tile);
            }
            gridTiles.Add(columnTiles);
        }

        WordData.ShuffleList(gridIndexes);
    }