错误提交
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using HxGame;
|
||||
using HxGame.Data;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -89,6 +90,49 @@ public partial class MapManager : MonoBehaviour
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public void LoadRegionXML(int mapId)
|
||||
{
|
||||
Transform regionsTrans = UIWindow.Instance.mapTrans.Find("Regions");
|
||||
if (regionsTrans == null)
|
||||
{
|
||||
UIWindow.Instance.ShowMessage("û<><C3BB><EFBFBD>ҵ<EFBFBD>Regions<6E>ڵ<EFBFBD>");
|
||||
return;
|
||||
}
|
||||
|
||||
MapRegions mapRegions = new MapRegions();
|
||||
mapRegions.mapWidth = Convert.ToInt32(txtMapWidth.text);
|
||||
mapRegions.mapHeight = Convert.ToInt32(txtMapHeight.text);
|
||||
mapRegions.regionWidth = Convert.ToInt32(txtRegionWidth.text);
|
||||
mapRegions.regionHeight = Convert.ToInt32(txtRegionHeight.text);
|
||||
|
||||
int row = mapRegions.mapWidth / MapManager.CELLSCALE / mapRegions.regionWidth;
|
||||
int col = mapRegions.mapHeight / MapManager.CELLSCALE / mapRegions.regionHeight;
|
||||
|
||||
Transform trans = null;
|
||||
mapRegions.regions = new Region[row, col];
|
||||
for (int i = 0; i < row; i++)
|
||||
{
|
||||
for (int j = 0; j < col; j++)
|
||||
{
|
||||
mapRegions.regions[i, j] = new Region();
|
||||
mapRegions.regions[i, j].indexX = i;
|
||||
mapRegions.regions[i, j].indexY = j;
|
||||
|
||||
string regionName = $"{i}_{j}";
|
||||
trans = regionsTrans.Find(regionName);
|
||||
if (trans == null)
|
||||
{
|
||||
UIWindow.Instance.ShowMessage($"û<><C3BB><EFBFBD>ҵ<EFBFBD>region<6F>ڵ<EFBFBD> name={regionName}");
|
||||
return;
|
||||
}
|
||||
|
||||
//mapRegions.regions[i, j].regionName = trans.GetComponent<Image>().sprite.name;
|
||||
mapRegions.regions[i, j].regionName = trans.GetComponent<RawImage>().texture.name;
|
||||
}
|
||||
}
|
||||
|
||||
mapRegions.SaveXML(mapId);
|
||||
}
|
||||
|
||||
public void LoadMapRegions(int mapId)
|
||||
{
|
||||
|
||||
@@ -46,7 +46,6 @@ public class UICellEditor : MonoBehaviour
|
||||
layerPanel.SetActive(false);
|
||||
AddInputNameClickEvent(txtStartPos);
|
||||
AddInputNameClickEvent(txtEndPos);
|
||||
UIWindow.Instance.HideMouseOver();
|
||||
}
|
||||
|
||||
private void AddInputNameClickEvent(InputField input) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Awake<6B>е<EFBFBD><D0B5><EFBFBD>
|
||||
@@ -210,7 +209,6 @@ public class UICellEditor : MonoBehaviour
|
||||
public void OnShowEffectsToggleChange()
|
||||
{
|
||||
MapManager.Instance.HideCells();
|
||||
UIWindow.Instance.ShowMouseOver();
|
||||
}
|
||||
|
||||
public void SetBrush()
|
||||
|
||||
@@ -112,12 +112,10 @@ public class UIMapPanel : MonoBehaviour
|
||||
UIWindow.Instance.ShowMessage("<22><><EFBFBD>ȹر<C8B9><D8B1><EFBFBD><EFBFBD>е<EFBFBD>ͼ");
|
||||
return;
|
||||
}
|
||||
|
||||
int mapId = 0;
|
||||
|
||||
mapId = Convert.ToInt32(dropMap.options[dropMap.value].text);
|
||||
//UIWindow.Instance.uiCreateMap.LoadMapRegions(mapId);
|
||||
//UIWindow.Instance.uiCellInfo.LoadCells();
|
||||
int mapId = Convert.ToInt32(dropMap.options[dropMap.value].text);
|
||||
_curOpenMapId = mapId;
|
||||
MapManager.Instance.LoadMapRegions(_curOpenMapId);
|
||||
UIWindow.Instance.uiCellInfo.LoadCells();
|
||||
//UIWindow.Instance.uiCellInfo.ShowCells();
|
||||
//UIWindow.Instance.uiEditMapConfig.LoadMapConfig(mapId);
|
||||
//UIWindow.Instance.uiMonstersPanel.LoadMonsterConfig(mapId);
|
||||
@@ -126,15 +124,12 @@ public class UIMapPanel : MonoBehaviour
|
||||
//UIWindow.Instance.uiFuBensPanel.LoadFuBenConfig(mapId);
|
||||
//UIWindow.Instance.uiJuBaosPanel.LoadJuBaoConfig(mapId);
|
||||
|
||||
_curOpenMapId = mapId;
|
||||
MapManager.Instance.LoadMapRegions(_curOpenMapId);
|
||||
}
|
||||
|
||||
public void CloseMap()
|
||||
{
|
||||
MapManager.Instance.CloseMap();
|
||||
_curOpenMapId = -1;
|
||||
UIWindow.Instance.HideMouseOver();
|
||||
}
|
||||
|
||||
public bool HasMap(string mapId)
|
||||
|
||||
@@ -69,18 +69,6 @@ public class UIWindow : MonoBehaviour
|
||||
uiMessageBox.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
public void ShowMouseOver()
|
||||
{
|
||||
newMapTrans.GetComponent<UIMouseOver>().enabled = true;
|
||||
bOvering = true;
|
||||
}
|
||||
|
||||
public void HideMouseOver()
|
||||
{
|
||||
newMapTrans.GetComponent<UIMouseOver>().enabled = false;
|
||||
bOvering = false;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (mapTrans == null)
|
||||
|
||||
Reference in New Issue
Block a user