row col 倒转之前

This commit is contained in:
2025-06-23 00:30:11 +08:00
parent 29c11f3642
commit 22a2ce0ea6
6 changed files with 21 additions and 378 deletions

View File

@@ -72,44 +72,4 @@ public class UICellInfo : MonoBehaviour
txtCellHeight.text = MapManager.heightPixel.ToString();
txtMoveCells.text = MapManager.Instance.map.selector.moveNum.ToString();
}
public void CalculationCells()
{
if (!bMapOpened)
return;
if (string.IsNullOrEmpty(txtMapWidth.text)
|| string.IsNullOrEmpty(txtMapWidth.text)
|| string.IsNullOrEmpty(txtCellHeight.text)
|| string.IsNullOrEmpty(txtCellHeight.text))
{
UIWindow.Instance.ShowMessage("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD>");
return;
}
int mapWidth = Convert.ToInt32(txtMapWidth.text);
int mapHeight = Convert.ToInt32(txtMapHeight.text);
int cellWidth = Convert.ToInt32(txtCellWidth.text);
int cellHeight = Convert.ToInt32(txtCellHeight.text);
if (mapWidth <= 0 || mapHeight <= 0 || cellWidth <= 0 || cellHeight <= 0)
{
UIWindow.Instance.ShowMessage("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30><EFBFBD><EFBFBD>ֵ");
return;
}
CalculationCells(mapWidth, mapHeight, cellWidth, cellHeight);
}
public void CalculationCells(int mapWidth, int mapHeight, int cellWidth, int cellHeight)
{
int row = mapHeight / cellHeight;
int col = mapWidth / cellWidth;
txtCellRows.text = row.ToString();
txtCellCols.text = col.ToString();
txtTotalCells.text = (row * col).ToString();
MapManager.Instance.CalculationCells(cellWidth, cellHeight, mapWidth, mapHeight);
}
}