新改动

This commit is contained in:
tangbin
2025-07-30 15:22:56 +08:00
parent f88a2e9504
commit 9331a51652
11 changed files with 30 additions and 26 deletions

View File

@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<config>
<Settings mapID="1" mapName="溪水村" enterLv="1" returnMapId="1" returnMapCellPointX="14" returnMapCellPointY="117" roleMode="18" useMode="15" deadFall="0" />
<Teleports />
<Settings mapID="1" mapName="溪水村" enterLv="1" returnMapId="1" returnMapCellPointX="41" returnMapCellPointY="20" roleMode="18" useMode="15" deadFall="0" />
<Teleports>
<Teleport posIndexX="98" posIndexY="97" nextMapId="3" nextMapPosIndexX="190" nextMapPosIndexY="220" />
</Teleports>
<ReliveAreas>
<ReliveArea type="0" mapId="1" indexX="14" indexY="117" radius="10" />
</ReliveAreas>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<config>
<Settings mapID="1" regionRowNum="7" regionColNum="5" regionWidth="1000" regionHeight="1000" cellWidthPixel="64" cellHeightPixel="32" />
<Settings mapID="1" regionRowNum="7" regionColNum="5" regionWidth="1000" regionHeight="1000" cellWidthPixel="60" cellHeightPixel="40" />
<Regions>
<Region IndexX="0" IndexY="0" regionName="v1_r5_c1" />
<Region IndexX="0" IndexY="1" regionName="v1_r4_c1" />

View File

@@ -5,19 +5,19 @@
<Npc id="1001" indexX="49" indexY="33" dir="3">
<NpcPaths />
</Npc>
<Npc id="1002" indexX="53" indexY="33" dir="3">
<Npc id="1002" indexX="55" indexY="46" dir="3">
<NpcPaths />
</Npc>
<Npc id="1003" indexX="66" indexY="58" dir="5">
<Npc id="1003" indexX="65" indexY="52" dir="5">
<NpcPaths />
</Npc>
<Npc id="1004" indexX="82" indexY="64" dir="5">
<NpcPaths />
</Npc>
<Npc id="1005" indexX="27" indexY="102" dir="7">
<Npc id="1005" indexX="22" indexY="80" dir="7">
<NpcPaths />
</Npc>
<Npc id="1006" indexX="73" indexY="39" dir="5">
<Npc id="1006" indexX="59" indexY="35" dir="5">
<NpcPaths />
</Npc>
<Npc id="1007" indexX="98" indexY="51" dir="3">

View File

@@ -9679,7 +9679,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &496305461
RectTransform:
m_ObjectHideFlags: 0
@@ -17052,7 +17052,6 @@ MonoBehaviour:
mapPic: {fileID: 1213416635}
mapWidth: 0
mapHeight: 0
_curOpenMapId: 0
mapRegionParent: {fileID: 782149589}
mapGridParent: {fileID: 504155531}
mapAreaParent: {fileID: 519310460}

View File

@@ -17,9 +17,9 @@ public partial class MapManager : MonoBehaviour
//<2F><>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public const int CELLSCALE = 100;
//<2F><><EFBFBD>ӿ<EFBFBD><D3BF><EFBFBD><EFBFBD><EFBFBD>
public const int widthPixel = 64;
public const int widthPixel = 60;
//<2F><><EFBFBD>Ӹ<EFBFBD><D3B8><EFBFBD><EFBFBD><EFBFBD>
public const int heightPixel = 32;
public const int heightPixel = 40;
//<2F><><EFBFBD>ŵ<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>
public int PicMapPixel => int.Parse(mapPic.text);
@@ -55,7 +55,10 @@ public partial class MapManager : MonoBehaviour
private int _cellCols;
//public CellNode[,] cellNodes;
public int _curOpenMapId;
public int _curOpenMapId {
get;
set;
}
private Material _cellMoveMat;
private Material _cellObsMat;

View File

@@ -73,6 +73,10 @@ public class SceneArea : MonoBehaviour
if (obj == null) return null;
GameObject cellObj = GameObject.Instantiate(obj,parentTrans);
var area = cellObj.GetComponent<SceneArea>();
if (area == null)
{
Debug.LogError($" {obj.name} <20><><EFBFBD><EFBFBD>...");
}
area.editCellType = baseItem.editCellType;
area.baseItem = baseItem;
baseItem.sceneArea = area;

View File

@@ -79,7 +79,7 @@ public class UICellInfo : MonoBehaviour
/// </summary>
public void LoadCell()
{
MapManager.Instance.LoadMapObs(UIWindow.Instance.uiMapPanel.CurOpenMapId);
MapManager.Instance.LoadMapObs(MapManager.Instance._curOpenMapId);
ShowMapCellInfo();
}
/// <summary>
@@ -91,7 +91,7 @@ public class UICellInfo : MonoBehaviour
int height = int.Parse(txtCellCols.text);
float cellW = int.Parse(txtCellWidth.text) / 100.0f;
float cellH = int.Parse(txtCellHeight.text) / 100.0f;
MapManager.Instance.GenerateMap(UIWindow.Instance.uiMapPanel.CurOpenMapId,width * cellW, height * cellH, cellW, cellH);
MapManager.Instance.GenerateMap(MapManager.Instance._curOpenMapId,width * cellW, height * cellH, cellW, cellH);
ShowMapCellInfo();
}
public void Update()

View File

@@ -14,14 +14,11 @@ public class UIMapPanel : MonoBehaviour
{
public ToggleGroup mapEditorGroup;
public Dropdown dropMap;
private int _curOpenMapId;
private bool _saving;
public int CurOpenMapId => _curOpenMapId;
// Start is called before the first frame update
void Start()
{
_saving = false;
_curOpenMapId = -1;
}
void OnDataLoaded()
@@ -112,26 +109,25 @@ public class UIMapPanel : MonoBehaviour
return;
}
if(_curOpenMapId > 0)
if(MapManager.Instance._curOpenMapId > 0)
{
UIWindow.Instance.ShowMessage("<22><><EFBFBD>ȹر<C8B9><D8B1><EFBFBD><EFBFBD>е<EFBFBD>ͼ");
return;
}
int mapId = Convert.ToInt32(dropMap.options[dropMap.value].text);
_curOpenMapId = mapId;
MapManager.Instance._curOpenMapId = mapId;
MapManager.Instance.LoadMapRegionSprites(mapId);
MapManager.Instance.LoadMapObs(mapId);
UIWindow.Instance.uiEditMapConfig.LoadMapConfig(mapId);
MapManager.Instance.LoadMapRegionSprites(_curOpenMapId);
MapManager.Instance.LoadMapObs(_curOpenMapId);
UIWindow.Instance.uiMonstersPanel.LoadMonsterConfig(mapId);
UIWindow.Instance.uiNpcsPanel.LoadNpcsConfig(mapId);
UIWindow.Instance.uiTriggersPanel.LoadTriggersConfig(mapId);
UIWindow.Instance.uiFuBensPanel.LoadFuBenConfig(mapId);
UIWindow.Instance.uiJuBaosPanel.LoadJuBaoConfig(mapId);
//<2F><><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD><C3A3><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if (MapManager.Instance.map == null)
{
MapManager.Instance.CreateObs(_curOpenMapId);
MapManager.Instance.CreateObs(mapId);
}
UICellInfo.Instance.ShowMapCellInfo();
}
@@ -139,7 +135,7 @@ public class UIMapPanel : MonoBehaviour
public void CloseMap()
{
MapManager.Instance.CloseMap();
_curOpenMapId = -1;
MapManager.Instance._curOpenMapId = -1;
foreach (var toggle in mapEditorGroup.ActiveToggles())
{
toggle.isOn = false;

View File

@@ -54,7 +54,7 @@ public class UITeleportPanel : MonoBehaviour
item.txtPos.text = $"{pos.x},{pos.y}";
item.txtNextMapID.text = nextMapId.ToString();
item.txtNextMapPos.text = $"{newMapPos.x},{newMapPos.y}";
item.editCellType = MapManager.EditCellType.TriggerCell;
item.editCellType = MapManager.EditCellType.TeleportCell;
MapManager.Instance.CreateSpecialPoint(pos, item);
}

View File

@@ -25,7 +25,7 @@ public class UIMouseOver : MonoBehaviour, IPointerClickHandler, IPointerEnterHan
public void OnPointerEnter(PointerEventData eventData)
{
if(UIWindow.Instance.uiMapPanel.CurOpenMapId < 0)
if(MapManager.Instance._curOpenMapId < 0)
{
UIWindow.Instance.ShowMessage("先打开地图");
return;