2025-08-07 16:44:43 +08:00
|
|
|
using System;
|
2025-09-19 08:26:54 +08:00
|
|
|
using Managers;
|
2025-08-07 16:44:43 +08:00
|
|
|
using UnityEngine;
|
2025-09-19 08:26:54 +08:00
|
|
|
using UnityEngine.Tilemaps;
|
|
|
|
|
using Utils;
|
2025-08-07 16:44:43 +08:00
|
|
|
|
|
|
|
|
namespace Map
|
|
|
|
|
{
|
2025-08-28 16:20:24 +08:00
|
|
|
public class MapGenerator : MonoBehaviour
|
2025-08-07 16:44:43 +08:00
|
|
|
{
|
2025-09-19 08:26:54 +08:00
|
|
|
public Tilemap baseTilemap;
|
|
|
|
|
public Tilemap buildingTilemap;
|
|
|
|
|
public Tilemap plantTilemap;
|
2025-09-03 19:59:22 +08:00
|
|
|
public void Init()
|
2025-08-19 20:22:10 +08:00
|
|
|
{
|
2025-09-19 08:26:54 +08:00
|
|
|
|
2025-08-07 16:44:43 +08:00
|
|
|
}
|
2025-08-28 16:20:24 +08:00
|
|
|
|
2025-09-03 19:59:22 +08:00
|
|
|
public Vector2Int GetSize()
|
|
|
|
|
{
|
2025-09-19 08:26:54 +08:00
|
|
|
return new Vector2Int(100, 100);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Vector2 GetWorldCoordinates(Vector2Int coord)
|
|
|
|
|
{
|
|
|
|
|
return transform.position + new Vector3(coord.x, coord.y);
|
2025-09-03 19:59:22 +08:00
|
|
|
}
|
|
|
|
|
|
2025-09-19 08:26:54 +08:00
|
|
|
public void Clear()
|
2025-09-03 19:59:22 +08:00
|
|
|
{
|
2025-09-19 08:26:54 +08:00
|
|
|
baseTilemap.ClearAllTiles();
|
|
|
|
|
buildingTilemap.ClearAllTiles();
|
|
|
|
|
plantTilemap.ClearAllTiles();
|
2025-09-03 19:59:22 +08:00
|
|
|
}
|
2025-08-07 16:44:43 +08:00
|
|
|
}
|
|
|
|
|
}
|