2025-06-14 13:46:24 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ - <20><>ɫ<EFBFBD><C9AB>
|
|
|
|
|
|
///<2F><><EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>
|
|
|
|
|
|
public class UICellInfo : MonoBehaviour
|
|
|
|
|
|
{
|
2025-06-17 00:23:38 +08:00
|
|
|
|
public static UICellInfo Instance;
|
2025-06-14 13:46:24 +08:00
|
|
|
|
public Text txtMapWidth;
|
|
|
|
|
|
public Text txtMapHeight;
|
|
|
|
|
|
public Text txtTotalCells;
|
|
|
|
|
|
public Text txtMoveCells;
|
|
|
|
|
|
public Text txtCellRows;
|
|
|
|
|
|
public Text txtCellCols;
|
|
|
|
|
|
public InputField txtCellWidth;
|
|
|
|
|
|
public InputField txtCellHeight;
|
|
|
|
|
|
|
|
|
|
|
|
public bool bMapOpened;
|
|
|
|
|
|
|
2025-06-17 00:23:38 +08:00
|
|
|
|
private void Awake()
|
|
|
|
|
|
{
|
|
|
|
|
|
Instance = this;
|
|
|
|
|
|
}
|
2025-06-14 13:46:24 +08:00
|
|
|
|
private void Start()
|
|
|
|
|
|
{
|
|
|
|
|
|
Cleanup();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Cleanup()
|
|
|
|
|
|
{
|
|
|
|
|
|
txtMapWidth.text = string.Empty;
|
|
|
|
|
|
txtMapHeight.text = string.Empty;
|
|
|
|
|
|
txtTotalCells.text = string.Empty;
|
|
|
|
|
|
txtMoveCells.text = string.Empty;
|
|
|
|
|
|
txtCellRows.text = string.Empty;
|
|
|
|
|
|
txtCellCols.text = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
txtCellWidth.text = string.Empty;
|
|
|
|
|
|
txtCellHeight.text = string.Empty;
|
|
|
|
|
|
bMapOpened = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void CloseMap()
|
|
|
|
|
|
{
|
|
|
|
|
|
Cleanup();
|
|
|
|
|
|
UIWindow.Instance.uiCellEditor.togEdit.isOn = false;
|
|
|
|
|
|
UIWindow.Instance.uiCellEditor.togPathTest.isOn = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
public void ShowCells()
|
|
|
|
|
|
{
|
2025-06-16 00:15:41 +08:00
|
|
|
|
MapManager.Instance.ShowMapGrid();
|
2025-06-14 13:46:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void HideCells()
|
|
|
|
|
|
{
|
2025-06-16 00:15:41 +08:00
|
|
|
|
MapManager.Instance.HideMapGrid();
|
2025-06-14 13:46:24 +08:00
|
|
|
|
}
|
2025-06-17 00:23:38 +08:00
|
|
|
|
public void ShowMapCellInfo()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (MapManager.Instance.map == null || MapManager.Instance.map.selector == null)
|
|
|
|
|
|
return;
|
|
|
|
|
|
if(MapManager.Instance._curMapRegions == null) return;
|
|
|
|
|
|
txtMapWidth.text = MapManager.Instance._curMapRegions.regionColNum.ToString();
|
|
|
|
|
|
txtMapHeight.text = MapManager.Instance._curMapRegions.regionRowNum.ToString();
|
|
|
|
|
|
txtCellRows.text = MapManager.Instance.map.selector.horizontalNumber.ToString();
|
|
|
|
|
|
txtCellCols.text = MapManager.Instance.map.selector.verticalNumber.ToString();
|
|
|
|
|
|
txtTotalCells.text = MapManager.Instance.map.selector.totalNumber.ToString();
|
|
|
|
|
|
txtCellWidth.text = MapManager.widthPixel.ToString();
|
|
|
|
|
|
txtCellHeight.text = MapManager.heightPixel.ToString();
|
|
|
|
|
|
txtMoveCells.text = MapManager.Instance.map.selector.moveNum.ToString();
|
|
|
|
|
|
}
|
2025-06-14 13:46:24 +08:00
|
|
|
|
}
|