void CheckIfQuickDropOrAtBottom(ref int vSpeed, ref bool advance) { if (Input.GetKeyDown(Controls.fallKey) || (advance && vSpeed == 0)) { int dx = 0, dy = -1; while (dy != 0) { ComputeMovement(ref dx, ref dy); MoveBlock(dx, dy); } foreach (Transform t in currentBlock.transform) { int x = Mathf.FloorToInt(t.position.x) - (int)_bounds.bottomLeft.x; int y = Mathf.FloorToInt(t.position.y) - (int)_bounds.bottomLeft.y; if (y < 0 || y > gridHeight - 1) { GameOver(); return; } grid[x, y] = t; } int nRowsCleared = 0; for (int y = 0; y < gridHeight; y++) { if (y >= 0 && IsFullRowAt(y)) { nRowsCleared++; DeleteRowAt(y); MoveRowsDownFrom(y); --y; } } if (nRowsCleared != 0) { int score; switch (nRowsCleared) { default: score = 100; break; case 2: score = 300; break; case 3: score = 600; break; case 4: score = 1000; break; } AddScore(score); AudioManager.Instance.PlaySound("clear" + nRowsCleared + "row"); for (int i = 0; i < nRowsCleared * 2; i++) { wall.ActivateRandomObject(); } } else { AudioManager.Instance.PlaySound("nextblock"); } currentBlock.PassChildrenTo(transform); CreateNextBlock(); return; } }