row col 倒转之前
This commit is contained in:
@@ -60,6 +60,10 @@ public class UICellEditor : MonoBehaviour
|
||||
AddInputNameClickEvent(txtStartPos);
|
||||
AddInputNameClickEvent(txtEndPos);
|
||||
}
|
||||
private void OnEnable()
|
||||
{
|
||||
MapManager.Instance.ResetCell();
|
||||
}
|
||||
|
||||
private void AddInputNameClickEvent(InputField input) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Awake<6B>е<EFBFBD><D0B5><EFBFBD>
|
||||
{
|
||||
@@ -205,16 +209,6 @@ public class UICellEditor : MonoBehaviour
|
||||
//ͼ<><CDBC><EFBFBD>༭
|
||||
public void OnShowLayerToggleChange()
|
||||
{
|
||||
CellType[] layers = (CellType[])Enum.GetValues(typeof(CellType));
|
||||
_layers = 0;
|
||||
for (int i= showgLayers.Length - 1; i>=0; i--)
|
||||
{
|
||||
if (showgLayers[i].isOn)
|
||||
_layers |= (int)layers[i];
|
||||
}
|
||||
|
||||
MapManager.Instance.ShowCells();
|
||||
MapManager.Instance.HideCellsExcludeLayers(_layers);
|
||||
}
|
||||
|
||||
//<2F>༭<EFBFBD><E0BCAD>Ч
|
||||
@@ -222,36 +216,6 @@ public class UICellEditor : MonoBehaviour
|
||||
{
|
||||
MapManager.Instance.HideCells();
|
||||
}
|
||||
public void EditorAreaToggleChange(Toggle t)
|
||||
{
|
||||
if (t.isOn)
|
||||
{
|
||||
switch (t.name)
|
||||
{
|
||||
case "MoveToggle":
|
||||
editorGrid = CellType.Move;
|
||||
break;
|
||||
case "BlockToggle":
|
||||
editorGrid = CellType.Obstacle;
|
||||
break;
|
||||
case "HideToggle":
|
||||
editorGrid = CellType.Hide;
|
||||
break;
|
||||
case "SafeToggle":
|
||||
editorGrid = CellType.Safe;
|
||||
break;
|
||||
case "StallToggle":
|
||||
editorGrid = CellType.Stall;
|
||||
break;
|
||||
}
|
||||
MapManager.Instance.map?.selector.RefreshPlaneRender();
|
||||
}
|
||||
if (editorAreaToggle.ActiveToggles().Count() == 0)
|
||||
{
|
||||
Debug.Log("û<><C3BB>ѡ<EFBFBD>б༭<D0B1><E0BCAD><EFBFBD><EFBFBD>");
|
||||
editorGrid = CellType.None;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>
|
||||
|
||||
@@ -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