This commit is contained in:
Lucastaa
2026-05-08 13:01:04 +07:00
parent 29dfa4d843
commit 5025383676
4 changed files with 14 additions and 5 deletions

View File

@@ -126,8 +126,8 @@ namespace Hallucinate.GameSetup.Maze
}
else
{
_grid = new MazeGrid(width, depth);
mazeRenderer.Initialize(_grid, mazeContainer);
// _grid = new MazeGrid(width, depth);
// mazeRenderer.Initialize(_grid, mazeContainer);
IMazeAlgorithm algorithm = GetAlgorithm(selectedAlgorithm);
@@ -139,6 +139,8 @@ namespace Hallucinate.GameSetup.Maze
{
algorithm.Generate(_grid);
}
_grid = new MazeGrid(width, depth);
mazeRenderer.Initialize(_grid, mazeContainer);
}
}
private void ShuffleList<T>(List<T> list)

View File

@@ -90,7 +90,7 @@ namespace Hallucinate.GameSetup.Maze
if (_spawnedCells.TryGetValue(posKey, out GameObject oldObj))
{
Destroy(oldObj);
if (oldObj != null) DestroyImmediate(oldObj);
_spawnedCells.Remove(posKey);
}
@@ -104,12 +104,17 @@ namespace Hallucinate.GameSetup.Maze
else
{
prefab = visualProfile.GetPrefab(type);
if (type == MazeCellType.StairsUp || type == MazeCellType.StairsDown)
{
rotation = Quaternion.Euler(0, visualProfile.stairsOffset, 0);
}
}
if (prefab == null) return;
float safeScale = Mathf.Max(0.001f, visualProfile.scale);
float modelScaleMultiplier = 0.25f;
float modelScaleMultiplier = 1f;
float yOffset = grid.Level * floorHeight;
Vector3 localPos = new Vector3(x * safeScale, yOffset, z * safeScale);

View File

@@ -9,6 +9,7 @@ namespace Hallucinate.GameSetup.Maze
public float tJunctionOffset = 0f;
public float cornerOffset = 0f;
public float deadEndOffset = 0f;
public float stairsOffset = 0f;
[Header("Prefabs")]
public GameObject wallPrefab;
@@ -28,7 +29,7 @@ namespace Hallucinate.GameSetup.Maze
public GameObject corridorDeadEnd;
[Header("Visualization Settings")]
public float scale = 1f;
public float scale = 0.167f;
public float animationDuration = 0.25f;
public GameObject GetPrefab(MazeCellType type)

View File

@@ -15,6 +15,7 @@ MonoBehaviour:
tJunctionOffset: 0
cornerOffset: 180
deadEndOffset: 0
stairsOffset: 180
wallPrefab: {fileID: 865692088774546613, guid: c49f25c5b1c3e4b43a2bc56717387124, type: 3}
corridorPrefab: {fileID: 919132149155446097, guid: 31c4154f4868c31419e8c1be5681fea1, type: 3}
processingPrefab: {fileID: 1560533784803380970, guid: 1e8b6ed6b01405e4b9e358abc8f7a058, type: 3}