row col 倒转之前
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user