// makes cells occupied by tetramino impassable public void FreezeTetraminoArea(TetraminoMono tetraminoMono) { Tetramino tetramino = tetraminoMono.tetramino; Vector2Int[] absPoses = tetramino.AbsPoses; LoopUtil.LoopAction((i) => { this[absPoses[i]] = new WallBlock(BlockType.Unspecified, tetraminoMono.GetChildGameObject(i)); } , absPoses.Length); DisplayBlocks.UpdateBlocks(); }
// makes cells occupied by tetramino impassable public void FreezeTetraminoArea(TetraminoMono tetraminoMono) { //foreach (Vector2Int pos in ) //{ // blocks[pos.x, pos.y] = new WallBlock(BlockType.Unspecified); //} Tetramino tetramino = tetraminoMono.tetramino; Vector2Int[] absPoses = tetramino.AbsPoses; LoopUtil.LoopAction((i) => { blocks[absPoses[i].x, absPoses[i].y] = new WallBlock(BlockType.Unspecified, tetraminoMono.GetChildGameObject(i)); } , absPoses.Length); DisplayBlocks.UpdateBlocks(); }