Improve maze start/end placement with dead-end detection

Refactored PlaceStartAndEnd to intelligently place start and end points at dead ends using random selection and distance-based fallbacks. Added EnforceSingleConnection to ensure start/end points have exactly one connection, compatible with U-turn prefabs. Improved MazeReworkSpawner with object hierarchy grouping (Floors, Categories) and made RefreshSingleCell public. Updated maze config and cleaned up scene hierarchy.
This commit is contained in:
2026-07-04 06:51:32 +07:00
parent 6b4a5a8e12
commit 531e28409a
6 changed files with 279 additions and 339 deletions

View File

@@ -13,13 +13,13 @@ MonoBehaviour:
m_Name: MazeRework
m_EditorClassIdentifier: Assembly-CSharp::Baba_yaga.GameSetup.MazeRework.MazeReworkConfig
algorithm: 0
width: 21
depth: 21
width: 13
depth: 13
useRandomSeed: 1
seed: 1337
seed: 1989
startLocation: {x: 1, y: 1}
generateRooms: 0
roomCount: 378
generateRooms: 1
roomCount: 2
minRoomSize: {x: 3, y: 3}
maxRoomSize: {x: 5, y: 5}
extraRoomDoorChance: 1