public void SetNull(Tetromino_2 tet) { foreach (Transform mino in tet.transform) { Vector2 pos = GridPosition(mino.position); grid[(int)pos.x, (int)pos.y] = null; } }
private void AddBlocks(List <Tetromino_2> T, Tetromino_2 a1, Tetromino_2 a2, Tetromino_2 a3, Tetromino_2 a4, Tetromino_2 a5, Tetromino_2 a6, Tetromino_2 a7) { T.Add(a1); T.Add(a2); T.Add(a3); T.Add(a4); T.Add(a5); T.Add(a6); T.Add(a7); }
public void UpdateGrid(Tetromino_2 t) { for (int y = 0; y < 25; y++) { for (int x = 0; x < 10; x++) { if (grid[x, y] != null) { if (grid[x, y].parent == t.transform) { grid[x, y] = null; } } } } foreach (Transform mino in t.transform) { Vector2 pos = GridPosition(mino.position); grid[(int)pos.x, (int)pos.y] = mino; } }
public void SetHold(Tetromino_2 tet) { hold = true; t = tet; }