This commit is contained in:
2025-06-16 00:15:41 +08:00
parent bcfa5ce1ec
commit 6d79a5baa1
16 changed files with 246 additions and 3838 deletions

View File

@@ -14,13 +14,9 @@ public partial class MapManager : MonoBehaviour
public event Action onMapCreated;
public CellType cellType;
public Map GenerateMap(float width, float height,float sideWidth, float sideHeight)
public Map GenerateMap(float width, float height, float sideWidth, float sideHeight)
{
if (map != null)
{
map.Release();
map = null;
}
ClearMapGrid();
map = new Map(width, height, sideWidth, sideHeight);
map.SetMapId(1000);
//默认设置半透明0.3
@@ -28,6 +24,25 @@ public partial class MapManager : MonoBehaviour
onMapCreated?.Invoke();
return map;
}
public void ClearMapGrid()
{
if (map != null)
{
map.Release();
map = null;
}
}
public void HideMapGrid()
{
if(map != null && map.mapGrid != null)
map.mapGrid.gameObject.SetActive(false);
}
public void ShowMapGrid()
{
if (map != null && map.mapGrid != null)
map.mapGrid.gameObject.SetActive(true);
}
public void ChangeGridAlpha(float alpha)
{
if (map == null)