提交
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user