private void HandleCheckRowsEvent(string nothing) { int points = 0, multiplicador = -1; for (int row = 1; row < width - 1; row++) { if (MatriceUtils.FullRow(row)) { multiplicador++; points += Points(row); MatriceUtils.EmptyRow(row); unityEvents[EventName.DestroyBlockEvent].Invoke(row.ToString()); } else if (MatriceUtils.RowIsEmpty(row)) { break; } } if (multiplicador >= 0) { AudioManager.Play(AudioClipName.Points); points += multiplicador * ConfigurationUtils.BonusPerRow; unityEvents[EventName.PointsEvent].Invoke(points.ToString()); Invoke("ReajustarMatriz", ConfigurationUtils.TimeDownBlocks); } }
private void ReajustarMatriz() { for (int row = 1; row < height - 2; row++) { if (MatriceUtils.RowIsEmpty(row)) { int bajar = 1, rowAux = row + 1; while (MatriceUtils.RowIsEmpty(rowAux) && rowAux < height - 1) { bajar++; rowAux++; } string datos = rowAux.ToString() + bajar.ToString(); unityEvents[EventName.DownBlockEvent].Invoke(datos); MatriceUtils.DownRows(row, bajar); } } }