(client) chore:支持unity的方式加载资源,调整文件名与定义的分布

This commit is contained in:
m0_75251201
2025-08-07 14:20:58 +08:00
parent 6a222d82b2
commit 17d09a8435
93 changed files with 5267 additions and 90 deletions

View File

@ -19,33 +19,7 @@ namespace Map
void Start()
{
TileManager.Instance.Init();
var mapSize = 10;
float noiseScale = 0.1f;
// 设置偏移量
offsetX = -5; // 示例:地图数据从 (-5, -5) 开始
offsetY = -5;
for (int x = 0; x < mapSize; x++)
{
List<int> col = new();
for (int y = 0; y < mapSize; y++)
{
// 计算柏林噪声值
float noiseValue = Mathf.PerlinNoise((x + offsetX) * noiseScale, (y + offsetY) * noiseScale);
if (noiseValue < 0.5f) // 小于 0.5 表示 Dirt
{
col.Add(TileManager.Instance.tileID.GetValueOrDefault("Dirt"));
}
else // 大于等于 0.5 表示 Grass
{
col.Add(TileManager.Instance.tileID.GetValueOrDefault("Grass"));
}
}
mapData.Add(col);
}
UpdateTexture();
}