From afc3a96bdf30d6b21b3ee3aa09850311baa8f2c2 Mon Sep 17 00:00:00 2001 From: tangbin <769851359@qq.com> Date: Fri, 27 Jun 2025 01:08:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=9D=90=E6=A0=87=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GameAssets/Maps/1000/XML/FuBensConfig.xml | 5 + .../Maps/1000/XML/FuBensConfig.xml.meta | 7 + .../GameAssets/Maps/1000/XML/JuBaosConfig.xml | 5 + .../Maps/1000/XML/JuBaosConfig.xml.meta | 7 + .../GameAssets/Maps/1000/XML/MapRegions.xml | 288 +++++++++--------- .../Maps/1000/XML/MonstersConfig.xml | 30 +- .../GameAssets/Maps/1000/XML/NpcsConfig.xml | 5 + .../Maps/1000/XML/NpcsConfig.xml.meta | 7 + Assets/GameAssets/Maps/1000/XML/Obs.bytes | Bin 105620 -> 105620 bytes .../Maps/1000/XML/TriggersConfig.xml | 5 + .../Maps/1000/XML/TriggersConfig.xml.meta | 7 + Assets/Scripts/Map/MapManager.Region.cs | 18 +- Assets/Scripts/UI/UICellEditor.cs | 31 +- Assets/Scripts/UI/UICellInfo.cs | 4 +- Assets/Scripts/UI/UIMapPanel.cs | 4 +- 15 files changed, 240 insertions(+), 183 deletions(-) create mode 100644 Assets/GameAssets/Maps/1000/XML/FuBensConfig.xml create mode 100644 Assets/GameAssets/Maps/1000/XML/FuBensConfig.xml.meta create mode 100644 Assets/GameAssets/Maps/1000/XML/JuBaosConfig.xml create mode 100644 Assets/GameAssets/Maps/1000/XML/JuBaosConfig.xml.meta create mode 100644 Assets/GameAssets/Maps/1000/XML/NpcsConfig.xml create mode 100644 Assets/GameAssets/Maps/1000/XML/NpcsConfig.xml.meta create mode 100644 Assets/GameAssets/Maps/1000/XML/TriggersConfig.xml create mode 100644 Assets/GameAssets/Maps/1000/XML/TriggersConfig.xml.meta diff --git a/Assets/GameAssets/Maps/1000/XML/FuBensConfig.xml b/Assets/GameAssets/Maps/1000/XML/FuBensConfig.xml new file mode 100644 index 0000000..43a5731 --- /dev/null +++ b/Assets/GameAssets/Maps/1000/XML/FuBensConfig.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Assets/GameAssets/Maps/1000/XML/FuBensConfig.xml.meta b/Assets/GameAssets/Maps/1000/XML/FuBensConfig.xml.meta new file mode 100644 index 0000000..360b9bb --- /dev/null +++ b/Assets/GameAssets/Maps/1000/XML/FuBensConfig.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 66f8a251ac81d884197f6254c573c98f +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameAssets/Maps/1000/XML/JuBaosConfig.xml b/Assets/GameAssets/Maps/1000/XML/JuBaosConfig.xml new file mode 100644 index 0000000..f1b1030 --- /dev/null +++ b/Assets/GameAssets/Maps/1000/XML/JuBaosConfig.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Assets/GameAssets/Maps/1000/XML/JuBaosConfig.xml.meta b/Assets/GameAssets/Maps/1000/XML/JuBaosConfig.xml.meta new file mode 100644 index 0000000..c8672c5 --- /dev/null +++ b/Assets/GameAssets/Maps/1000/XML/JuBaosConfig.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 12c1eef45241a2c489549d2e39d6a4bc +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameAssets/Maps/1000/XML/MapRegions.xml b/Assets/GameAssets/Maps/1000/XML/MapRegions.xml index 48b6d9f..d302bfe 100644 --- a/Assets/GameAssets/Maps/1000/XML/MapRegions.xml +++ b/Assets/GameAssets/Maps/1000/XML/MapRegions.xml @@ -1,160 +1,160 @@  - + - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Assets/GameAssets/Maps/1000/XML/MonstersConfig.xml b/Assets/GameAssets/Maps/1000/XML/MonstersConfig.xml index 27e94b9..fe5e594 100644 --- a/Assets/GameAssets/Maps/1000/XML/MonstersConfig.xml +++ b/Assets/GameAssets/Maps/1000/XML/MonstersConfig.xml @@ -1,27 +1,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/Assets/GameAssets/Maps/1000/XML/NpcsConfig.xml b/Assets/GameAssets/Maps/1000/XML/NpcsConfig.xml new file mode 100644 index 0000000..baceebe --- /dev/null +++ b/Assets/GameAssets/Maps/1000/XML/NpcsConfig.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Assets/GameAssets/Maps/1000/XML/NpcsConfig.xml.meta b/Assets/GameAssets/Maps/1000/XML/NpcsConfig.xml.meta new file mode 100644 index 0000000..3161f36 --- /dev/null +++ b/Assets/GameAssets/Maps/1000/XML/NpcsConfig.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fc561ceed3a642c4d958dd1886283a70 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameAssets/Maps/1000/XML/Obs.bytes b/Assets/GameAssets/Maps/1000/XML/Obs.bytes index c6d435d113c168501a5b30b40ff8dbc0205393cf..daa461b883119d5c3547687c3deb8baefdd1f8b6 100644 GIT binary patch delta 76 jcmbQTlWodQwhbE7CvVszvH8I%2PSeDe>QAX@NfeF=^!WB delta 129 zcmbQTlWodQwhbE7H!5_fPHvbfv3bHw2PSeD9!wh*IDp1%5eMoP*c`Cb17r*#hByEh CB{oq2 diff --git a/Assets/GameAssets/Maps/1000/XML/TriggersConfig.xml b/Assets/GameAssets/Maps/1000/XML/TriggersConfig.xml new file mode 100644 index 0000000..426442f --- /dev/null +++ b/Assets/GameAssets/Maps/1000/XML/TriggersConfig.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Assets/GameAssets/Maps/1000/XML/TriggersConfig.xml.meta b/Assets/GameAssets/Maps/1000/XML/TriggersConfig.xml.meta new file mode 100644 index 0000000..f413a02 --- /dev/null +++ b/Assets/GameAssets/Maps/1000/XML/TriggersConfig.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3ce3f796d0a4e1541aaa542c69a1179b +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Map/MapManager.Region.cs b/Assets/Scripts/Map/MapManager.Region.cs index 46c313f..361cee9 100644 --- a/Assets/Scripts/Map/MapManager.Region.cs +++ b/Assets/Scripts/Map/MapManager.Region.cs @@ -69,26 +69,28 @@ public partial class MapManager : MonoBehaviour _curMapRegions.cellWidthPixel = widthPixel; _curMapRegions.cellHeightPixel = heightPixel; _curMapRegions.regions = new Region[mapRownum, mapColumn]; + + int maxRow = mapColumn; + int maxCol = mapRownum; float jpgscenew = PicMapPixel / 100.0f; - for (int row = 0; row < mapRownum; row++) + + for (int row = 0; row < mapRownum; row++) //14 * 11 { for (int col = 0; col < mapColumn; col++) { - string filename = $"v{mapId}_r{row + 1}_c{col + 1}"; // ¹¹ÔìÎļþÃû£¬v1000_r1_c1.jpg + string filename = $"v{mapId}_r{mapColumn - col}_c{row + 1}"; // ¹¹ÔìÎļþÃû£¬v1000_r11_c1.jpg string spPath = PathUtil.GetMapTexure(1000, filename, "jpg"); GameObject obj = new GameObject(filename); obj.transform.SetParent(mapRegionParent); SpriteRenderer sr = obj.AddComponent(); - float x = col * jpgscenew; - float y = (mapRownum - row - 1) * jpgscenew; + float x = row * jpgscenew; + float y = col * jpgscenew; obj.transform.position = new Vector2(x, y); _curMapRegions.regions[row, col] = new Region(); _curMapRegions.regions[row, col].indexX = row; _curMapRegions.regions[row, col].indexY = col; multithreadLoadTextrue(spPath, sr); - int ldx = mapRownum - row; - int ldy = col + 1; - _curMapRegions.regions[row, col].regionName = $"v{mapId}_r{ldx}_c{ldy}"; // ¹¹ÔìÎļþÃû£¬v1000_r1_c1.jpg + _curMapRegions.regions[row, col].regionName = filename; } } MapManager.Instance.ReseCamera(jpgscenew * mapColumn, jpgscenew * mapRownum); @@ -106,7 +108,7 @@ public partial class MapManager : MonoBehaviour { if(_curMapRegions == null) return; float jpgscenew = PicMapPixel / 100.0f; - MapManager.Instance.GenerateMap(jpgscenew * _curMapRegions.regionColNum, jpgscenew * _curMapRegions.regionRowNum, _curMapRegions.cellWidthPixel / 100.0f, _curMapRegions.cellHeightPixel / 100.0f); + MapManager.Instance.GenerateMap(jpgscenew * _curMapRegions.regionRowNum, jpgscenew * _curMapRegions.regionColNum, _curMapRegions.cellWidthPixel / 100.0f, _curMapRegions.cellHeightPixel / 100.0f); } private async void multithreadLoadTextrue(string fullPath,SpriteRenderer sr) { diff --git a/Assets/Scripts/UI/UICellEditor.cs b/Assets/Scripts/UI/UICellEditor.cs index 32d77f7..04c764f 100644 --- a/Assets/Scripts/UI/UICellEditor.cs +++ b/Assets/Scripts/UI/UICellEditor.cs @@ -216,7 +216,36 @@ 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("ûÓÐÑ¡ÖÐ±à¼­ÇøÓò"); + editorGrid = CellType.None; + } + } /// /// Çå³ýËùÑ¡ÇøÓò /// diff --git a/Assets/Scripts/UI/UICellInfo.cs b/Assets/Scripts/UI/UICellInfo.cs index 554e2d1..6a6b2e9 100644 --- a/Assets/Scripts/UI/UICellInfo.cs +++ b/Assets/Scripts/UI/UICellInfo.cs @@ -63,8 +63,8 @@ public class UICellInfo : MonoBehaviour 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(); + txtMapWidth.text = MapManager.Instance._curMapRegions.regionRowNum.ToString(); + txtMapHeight.text = MapManager.Instance._curMapRegions.regionColNum.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(); diff --git a/Assets/Scripts/UI/UIMapPanel.cs b/Assets/Scripts/UI/UIMapPanel.cs index 5134c8a..19eb84e 100644 --- a/Assets/Scripts/UI/UIMapPanel.cs +++ b/Assets/Scripts/UI/UIMapPanel.cs @@ -69,8 +69,8 @@ public class UIMapPanel : MonoBehaviour if (maxRow > 0 && maxCol > 0) { - MapManager.Instance.allMaps[mapId] = (maxRow, maxCol); - Debug.Log($"Map {mapId} loaded with max dimensions: {maxRow}x{maxCol}"); + MapManager.Instance.allMaps[mapId] = (maxCol, maxRow); + Debug.Log($"Map {mapId} loaded with max dimensions: {maxCol}x{maxRow}"); } else {