2025-08-07 16:44:43 +08:00
|
|
|
using System;
|
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.Tilemaps;
|
|
|
|
|
|
|
|
namespace Map
|
|
|
|
{
|
2025-08-11 12:45:52 +08:00
|
|
|
public class MapGenerator:Utils.MonoSingleton<MapGenerator>
|
2025-08-07 16:44:43 +08:00
|
|
|
{
|
|
|
|
public DoubleMap baseLevel;
|
|
|
|
public Tilemap buildLevel;
|
|
|
|
public Tilemap plantLevel;
|
|
|
|
|
|
|
|
public void Start()
|
|
|
|
{
|
|
|
|
var perline= Utils.PerlinNoise.Instance;
|
|
|
|
int size = 100;
|
2025-08-11 12:45:52 +08:00
|
|
|
baseLevel.InitializeData(size, size);
|
|
|
|
baseLevel.RefreshAllTiles();
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool CanPassThrough(int x, int y)
|
|
|
|
{
|
|
|
|
return GetTileCost(x, y) < 1;
|
|
|
|
}
|
|
|
|
public float GetTileCost(int x, int y)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void OnStart()
|
|
|
|
{
|
|
|
|
|
2025-08-07 16:44:43 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|