public void MoveTetromino(Vector3 center, Tetromino tetromino) { for (var i = 0; i < tetromino.BlockCount; i++) { var localPos = tetromino.GetLocalBlockPosition(i); var pos = center + new Vector3(localPos.x, localPos.y, 0); tetromino.MoveBlock(i, pos); } }
public void UpdateTetrominoPositionInGrids(Tetromino tetromino) { var center = tetromino.Center; for (var i = 0; i < tetromino.BlockCount; i++) { var gridPos = center + tetromino.GetLocalBlockPosition(i); var pos = GetBlockPosition(gridPos); tetromino.MoveBlock(i, pos); } }