新改动

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

@@ -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);
}