新改动
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user