稍微修改

This commit is contained in:
tangbin
2025-09-10 20:01:05 +08:00
parent deab39ea12
commit c74d65a74f
6 changed files with 80 additions and 68 deletions

View File

@@ -22,8 +22,8 @@ public class GridSelector : MonoBehaviour
private MeshCollider mapCollider;
private Map map;
public int horizontalNumber { get { return Mathf.CeilToInt(map.width / map.sideWidth); } }
public int verticalNumber { get { return Mathf.CeilToInt(map.height / map.sideHeight); } }
public int horizontalNumber { get { return Mathf.FloorToInt(map.width / map.sideWidth); } }
public int verticalNumber { get { return Mathf.FloorToInt(map.height / map.sideHeight); } }
public int totalNumber { get { return horizontalNumber * verticalNumber; } }
public int moveNum;
@@ -335,6 +335,7 @@ public class GridSelector : MonoBehaviour
}
else if (selectedGridIndex.Count == 1)
{
#if UNITY_EDITOR
int beginIndex = selectedGridIndex[0];
GetXyByIndex(beginIndex, out int x, out int y);
string labelText = string.Format(
@@ -346,8 +347,7 @@ public class GridSelector : MonoBehaviour
labelText,
style
);
//GUI.Label(new Rect(width - 820, 20, 400, 50), string.Format("所选点XY序列({0},{1}) 高度{2} 点类型 {3}", x, y, ((dataArray[beginIndex].barrier >> 16) - 10000)/100.0f, CellTypeColors.GetAreaStr((dataArray[beginIndex].barrier)), style));
#endif
}
else
{

View File

@@ -183,7 +183,7 @@ public partial class MapManager : MonoBehaviour
{
for (int col = 0; col < mapColumn; col++)
{
string filename = $"v{mapId}_r{mapColumn - col}_c{row + 1}"; // <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>v1000_r11_c1.jpg
string filename = isSmallPic ? $"v{mapId}_r{mapColumn - col}_c{row + 1}" : $"r{mapColumn - col}_c{row + 1}"; // <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>v1000_r11_c1.jpg
string spPath = PathUtil.GetMapTexure(mapId, filename, "jpg");
GameObject obj = new GameObject(filename);
obj.transform.SetParent(mapRegionParent);

View File

@@ -23,6 +23,8 @@ public partial class MapManager : MonoBehaviour
//<2F><><EFBFBD>ŵ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>
public int PicMapPixel => int.Parse(mapPic.text);
public bool isSmallPic => PicMapPixel == 512;
public delegate void LoadFinishedCallback();
public LoadFinishedCallback onLoadFinishedCallback;
//public delegate void CloseMapCallback();