save
This commit is contained in:
14
.idea/.idea.BABA_YAGA/.idea/workspace.xml
generated
14
.idea/.idea.BABA_YAGA/.idea/workspace.xml
generated
@@ -12,16 +12,12 @@
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="d308d1cb-09fc-4331-ba20-00f7b43d1576" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.BABA_YAGA/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.BABA_YAGA/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Materials/Red 1.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Materials/Red 1.mat" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Materials/Red 2.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Materials/Red 2.mat" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Environment/Hall/MazeVisualize.prefab" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Environment/Hall/MazeVisualize.prefab" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Materials/Red 4.mat" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Materials/Red 4.mat" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Environment/Room/Stair.prefab" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Environment/Room/Stair.prefab" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Presets/MazeRework.asset" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Presets/MazeRework.asset" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/Algorithms/DFSIterative.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/Algorithms/DFSIterative.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/Algorithms/DFSRecursive.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/Algorithms/DFSRecursive.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/Algorithms/Kruskals.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/Algorithms/Kruskals.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/Algorithms/Prims.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/Algorithms/Prims.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/Animation/MazeAnimator.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/Animation/MazeAnimator.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/Animation/MazeCellHighlight.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/Animation/MazeCellHighlight.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scenes/Main Scene.unity" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scenes/Main Scene.unity" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/MazeReworkGenerator.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/MazeReworkGenerator.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/MazeReworkManager.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/MazeReworkManager.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/MazeReworkSpawner.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Baba_yaga/GameSetup/MazeRework/MazeReworkSpawner.cs" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
||||
@@ -125,9 +125,9 @@ Material:
|
||||
- _XRMotionVectorsPass: 1
|
||||
- _ZWrite: 0
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 0, g: 0, b: 0, a: 0.54509807}
|
||||
- _Color: {r: 0, g: 0, b: 0, a: 0.54509807}
|
||||
- _EmissionColor: {r: 0.38679248, g: 0.38679248, b: 0.38679248, a: 1}
|
||||
- _BaseColor: {r: 1, g: 0, b: 0, a: 0.54509807}
|
||||
- _Color: {r: 1, g: 0, b: 0, a: 0.54509807}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
|
||||
m_BuildTextureStacks: []
|
||||
m_AllowLocking: 1
|
||||
|
||||
@@ -25,7 +25,7 @@ Transform:
|
||||
m_GameObject: {fileID: 2383264816881362551}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 10, z: 0}
|
||||
m_LocalPosition: {x: 0, y: 8.5, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
@@ -37,8 +37,73 @@ Transform:
|
||||
- {fileID: 3598916540148757750}
|
||||
- {fileID: 3173910591291584886}
|
||||
- {fileID: 3627430670674956908}
|
||||
- {fileID: 2112656565862218701}
|
||||
- {fileID: 209778860858744480}
|
||||
- {fileID: 7824694722502263846}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &214166505238629404
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 8521218631316099782}
|
||||
m_Modifications:
|
||||
- target: {fileID: 1772560649162570, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: HallDivider
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: -4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
--- !u!4 &209778860858744480 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
m_PrefabInstance: {fileID: 214166505238629404}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &1293495628175984358
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -101,6 +166,68 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 4127635367186896, guid: c2d5177496a74d742a60db11d5a6bc45, type: 3}
|
||||
m_PrefabInstance: {fileID: 1293495628175984358}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &2116204155443583869
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 8521218631316099782}
|
||||
m_Modifications:
|
||||
- target: {fileID: 1082308075524082, guid: 87a83f27294ac0749a7b46b19969a490, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: CeilingLightRectangle
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4483273996017840, guid: 87a83f27294ac0749a7b46b19969a490, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: -0.0000003576278
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4483273996017840, guid: 87a83f27294ac0749a7b46b19969a490, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4483273996017840, guid: 87a83f27294ac0749a7b46b19969a490, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: -3
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4483273996017840, guid: 87a83f27294ac0749a7b46b19969a490, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 0.7071068
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4483273996017840, guid: 87a83f27294ac0749a7b46b19969a490, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4483273996017840, guid: 87a83f27294ac0749a7b46b19969a490, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0.7071068
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4483273996017840, guid: 87a83f27294ac0749a7b46b19969a490, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4483273996017840, guid: 87a83f27294ac0749a7b46b19969a490, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4483273996017840, guid: 87a83f27294ac0749a7b46b19969a490, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 90
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4483273996017840, guid: 87a83f27294ac0749a7b46b19969a490, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 87a83f27294ac0749a7b46b19969a490, type: 3}
|
||||
--- !u!4 &2112656565862218701 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 4483273996017840, guid: 87a83f27294ac0749a7b46b19969a490, type: 3}
|
||||
m_PrefabInstance: {fileID: 2116204155443583869}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &3177995410589301080
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -535,3 +662,65 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 4565015719423054, guid: 00bce47c2b02a1e49928328f8a27c7cd, type: 3}
|
||||
m_PrefabInstance: {fileID: 6732979841283630374}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &7820344531341612698
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 8521218631316099782}
|
||||
m_Modifications:
|
||||
- target: {fileID: 1772560649162570, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_Name
|
||||
value: HallDivider (1)
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -8
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: -4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
--- !u!4 &7824694722502263846 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 4951712646697660, guid: f28734d4c47efd14b9165e51b39d9a3c, type: 3}
|
||||
m_PrefabInstance: {fileID: 7820344531341612698}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
|
||||
@@ -12,9 +12,9 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 30892b1102feb6841a9288ddb11ef50d, type: 3}
|
||||
m_Name: MazeRework
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Baba_yaga.GameSetup.MazeRework.MazeReworkConfig
|
||||
algorithm: 3
|
||||
width: 10
|
||||
depth: 10
|
||||
algorithm: 0
|
||||
width: 21
|
||||
depth: 21
|
||||
useRandomSeed: 1
|
||||
seed: 1337
|
||||
startLocation: {x: 1, y: 1}
|
||||
|
||||
@@ -277,7 +277,7 @@ Transform:
|
||||
m_GameObject: {fileID: 786488}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 3.5546, y: -5.79626, z: 4.39807}
|
||||
m_LocalPosition: {x: 3.5546, y: 7, z: 4.39807}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
@@ -314,6 +314,7 @@ Transform:
|
||||
m_Children:
|
||||
- {fileID: 828777830}
|
||||
- {fileID: 1768466479}
|
||||
- {fileID: 1170687049}
|
||||
- {fileID: 1100452909}
|
||||
m_Father: {fileID: 656189834}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -491,7 +492,7 @@ Transform:
|
||||
m_GameObject: {fileID: 620725563}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalPosition: {x: 0, y: 7, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
@@ -523,7 +524,7 @@ Transform:
|
||||
m_GameObject: {fileID: 656189833}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -3.5546, y: 5.79626, z: -4.39807}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
@@ -560,7 +561,7 @@ Transform:
|
||||
m_GameObject: {fileID: 747234399}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalPosition: {x: 0, y: 7, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
@@ -634,7 +635,7 @@ Transform:
|
||||
m_GameObject: {fileID: 751090086}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 345, y: 194, z: 0}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
@@ -657,7 +658,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!114 &828777829
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -682,7 +683,7 @@ Transform:
|
||||
m_GameObject: {fileID: 828777828}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalPosition: {x: 0, y: 7, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
@@ -746,7 +747,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!4 &1100452909
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -756,7 +757,7 @@ Transform:
|
||||
m_GameObject: {fileID: 1100452908}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalPosition: {x: 0, y: 7, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
@@ -795,6 +796,150 @@ MonoBehaviour:
|
||||
straightManHoleUp: {fileID: 919132149155446097, guid: df993452c905ccd4a8db16303509c4aa, type: 3}
|
||||
deadendManHoleLadder: {fileID: 919132149155446097, guid: c7b8e72ff8d936143a810e1baa494428, type: 3}
|
||||
deadendManHoleUp: {fileID: 919132149155446097, guid: 1e0fe08755c202644ab57e3ecb75ea61, type: 3}
|
||||
--- !u!1 &1119991879
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1119991880}
|
||||
m_Layer: 0
|
||||
m_Name: GameObject
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1119991880
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1119991879}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.1, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1170687048
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1170687049}
|
||||
- component: {fileID: 1170687052}
|
||||
- component: {fileID: 1170687051}
|
||||
- component: {fileID: 1170687050}
|
||||
m_Layer: 0
|
||||
m_Name: Update plan
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1170687049
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1170687048}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 393.9129, y: 5, z: 251.7189}
|
||||
m_LocalScale: {x: 10, y: 1, z: 10}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 346257372}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!64 &1170687050
|
||||
MeshCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1170687048}
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
serializedVersion: 5
|
||||
m_Convex: 0
|
||||
m_CookingOptions: 30
|
||||
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &1170687051
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1170687048}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 1
|
||||
m_ReceiveShadows: 1
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 2
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_ForceMeshLod: -1
|
||||
m_MeshLodSelectionBias: 0
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: e2e2684e969402049b87d7f81417c603, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 3
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_GlobalIlluminationMeshLod: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_MaskInteraction: 0
|
||||
m_AdditionalVertexStreams: {fileID: 0}
|
||||
--- !u!33 &1170687052
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1170687048}
|
||||
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!1001 &1216657555
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -821,7 +966,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7418421637809006319, guid: 65ca090fdbcb6fe418518ecc53625855, type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 8.68205
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7418421637809006319, guid: 65ca090fdbcb6fe418518ecc53625855, type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
@@ -829,7 +974,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7418421637809006319, guid: 65ca090fdbcb6fe418518ecc53625855, type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0.23688984
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7418421637809006319, guid: 65ca090fdbcb6fe418518ecc53625855, type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
@@ -837,15 +982,15 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7418421637809006319, guid: 65ca090fdbcb6fe418518ecc53625855, type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: -0
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7418421637809006319, guid: 65ca090fdbcb6fe418518ecc53625855, type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: -0
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7418421637809006319, guid: 65ca090fdbcb6fe418518ecc53625855, type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: -0
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7418421637809006319, guid: 65ca090fdbcb6fe418518ecc53625855, type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
@@ -1066,8 +1211,8 @@ Transform:
|
||||
m_GameObject: {fileID: 1768466478}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: -10, z: 0}
|
||||
m_LocalScale: {x: 50, y: 1, z: 50}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 100, y: 1, z: 100}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 346257372}
|
||||
@@ -1151,6 +1296,111 @@ MeshFilter:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1768466478}
|
||||
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!1 &1896629830
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1896629832}
|
||||
- component: {fileID: 1896629831}
|
||||
- component: {fileID: 1896629833}
|
||||
- component: {fileID: 1896629834}
|
||||
m_Layer: 0
|
||||
m_Name: MazeRework
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1896629831
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1896629830}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e30aa4eff6d79394ea1a19fe77e97b1e, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Baba_yaga.GameSetup.MazeRework.MazeReworkManager
|
||||
config: {fileID: 11400000, guid: aa314bbd2a1b4fd43be6b704d129a55b, type: 2}
|
||||
spawner: {fileID: 1896629833}
|
||||
mazeContainer: {fileID: 1119991880}
|
||||
animator: {fileID: 1896629834}
|
||||
animateGeneration: 0
|
||||
floorCount: 5
|
||||
floorHeight: 8.4
|
||||
connectionsPerFloor: 2
|
||||
--- !u!4 &1896629832
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1896629830}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -33.08711, y: 2.5, z: -1.2811}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1896629833
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1896629830}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 8d9d9bca23a6e664fa3f01d404f31beb, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Baba_yaga.GameSetup.MazeRework.MazeReworkSpawner
|
||||
hallPrefab: {fileID: 1264748121136002, guid: 1652aa5a752a65148a198afb1c8933d2, type: 3}
|
||||
hallDoubleRoomPrefab: {fileID: 6379694822479300082, guid: 7631ae62165c0c34aa159e786cbeeefa, type: 3}
|
||||
hallTPrefab: {fileID: 1907757158894496, guid: 95d0988761bfc144e9325a126719df2b, type: 3}
|
||||
turnPrefab: {fileID: 8012312779246352912, guid: d219046e124aac24bb6589d06740c861, type: 3}
|
||||
uTurnPrefab: {fileID: 817386962124533542, guid: f147133c37d69764abf51ce8374aed85, type: 3}
|
||||
beginningPrefab: {fileID: 3191829577792489586, guid: 233c4a06ba6a4104fb0ea5e9725f948c, type: 3}
|
||||
endPrefab: {fileID: 3191829577792489586, guid: 2f5f6e6fe84c213459d0312e25f6d636, type: 3}
|
||||
stairPrefab: {fileID: 2383264816881362551, guid: 4068079ff983733439d9bdddff56ea18, type: 3}
|
||||
isPreviewMode: 0
|
||||
previewPathPrefab: {fileID: 4040231326986631665, guid: dbc41620be31d434784e8df8019f7c2d, type: 3}
|
||||
previewWallPrefab: {fileID: 8076923981149454332, guid: cbacd462ff8b59647b1ab66ee481e934, type: 3}
|
||||
searchHeadPrefab: {fileID: 6831072708289238637, guid: 085ffdfee17437a4f8e0d3c365edcc24, type: 3}
|
||||
frontierPrefab: {fileID: 7410088413158269499, guid: 17f01b6b44475394da68b1ca1d8d7eb4, type: 3}
|
||||
evaluatingPrefab: {fileID: 1196592758819373226, guid: c39adeeb3a17d824392cc018d65aedc4, type: 3}
|
||||
hallRotationOffset: 0
|
||||
hallDoubleRoomRotationOffset: 0
|
||||
hallTRotationOffset: -90
|
||||
turnRotationOffset: 0
|
||||
uTurnRotationOffset: 0
|
||||
beginningRotationOffset: 0
|
||||
endRotationOffset: 0
|
||||
stairRotationOffset: -180
|
||||
stairHeightOffset: 8.5
|
||||
spacing: 10
|
||||
--- !u!114 &1896629834
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1896629830}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 209db07e0fcae2e4e9e8b9e2fb822e31, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Baba_yaga.GameSetup.MazeRework.Animation.MazeAnimator
|
||||
cellsPerFrame: 1
|
||||
stepDelay: 0.05
|
||||
delayBetweenPhases: 0.5
|
||||
--- !u!1 &1945212509
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1176,7 +1426,7 @@ Transform:
|
||||
m_GameObject: {fileID: 1945212509}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 3.78801, y: -4.20374, z: -9.42587}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
@@ -1310,3 +1560,5 @@ SceneRoots:
|
||||
- {fileID: 656189834}
|
||||
- {fileID: 1945212510}
|
||||
- {fileID: 1216657555}
|
||||
- {fileID: 1896629832}
|
||||
- {fileID: 1119991880}
|
||||
|
||||
@@ -67,8 +67,9 @@ namespace Baba_yaga.GameSetup.MazeRework
|
||||
|
||||
/// <summary>
|
||||
/// Generates a 2D layout of the maze of size config.width by config.depth using a specific seed.
|
||||
/// Generates the maze grid.
|
||||
/// </summary>
|
||||
public MazeReworkCellType[,] Generate(int seed)
|
||||
public MazeReworkCellType[,] Generate(int seed, Vector2Int? forcedStart = null, Vector2Int? forcedDirection = null)
|
||||
{
|
||||
if (_config == null) return null;
|
||||
|
||||
@@ -95,14 +96,30 @@ namespace Baba_yaga.GameSetup.MazeRework
|
||||
InitializeVisitedMap(grid, visited, rooms, width, depth);
|
||||
|
||||
// 4. Select starting coordinates
|
||||
int startX = _config.startLocation.x;
|
||||
int startZ = _config.startLocation.y;
|
||||
EnsureValidOddCoordinates(width, depth, ref startX, ref startZ);
|
||||
int startX = forcedStart.HasValue ? forcedStart.Value.x : _config.startLocation.x;
|
||||
int startZ = forcedStart.HasValue ? forcedStart.Value.y : _config.startLocation.y;
|
||||
if (!forcedStart.HasValue)
|
||||
{
|
||||
EnsureValidOddCoordinates(width, depth, ref startX, ref startZ);
|
||||
}
|
||||
|
||||
// 5. Carve Corridors using the selected algorithm
|
||||
visited[startX, startZ] = true;
|
||||
grid[startX, startZ] = MazeReworkCellType.Corridor;
|
||||
IMazeReworkAlgorithm algorithm = GetAlgorithm();
|
||||
|
||||
if (forcedDirection.HasValue)
|
||||
{
|
||||
int fx = startX + forcedDirection.Value.x;
|
||||
int fz = startZ + forcedDirection.Value.y;
|
||||
if (fx >= 0 && fx < width && fz >= 0 && fz < depth && !visited[fx, fz])
|
||||
{
|
||||
visited[fx, fz] = true;
|
||||
grid[fx, fz] = MazeReworkCellType.Corridor;
|
||||
algorithm.Carve(grid, visited, fx, fz, width, depth, rng);
|
||||
}
|
||||
}
|
||||
|
||||
algorithm.Carve(grid, visited, startX, startZ, width, depth, rng);
|
||||
|
||||
// 6. Hunt & Kill scan to connect isolated rooms/corridors
|
||||
@@ -112,7 +129,7 @@ namespace Baba_yaga.GameSetup.MazeRework
|
||||
CarveLoops(grid, rng, width, depth);
|
||||
|
||||
// 8. Place Start & End points
|
||||
PlaceStartAndEnd(grid, rooms, width, depth);
|
||||
PlaceStartAndEnd(grid, rooms, width, depth, forcedStart, forcedDirection, null);
|
||||
|
||||
return grid;
|
||||
}
|
||||
@@ -132,7 +149,7 @@ namespace Baba_yaga.GameSetup.MazeRework
|
||||
return GenerateAnimated(seed);
|
||||
}
|
||||
|
||||
public (MazeReworkCellType[,] grid, List<MazeCellChange> history) GenerateAnimated(int seed)
|
||||
public (MazeReworkCellType[,] grid, List<MazeCellChange> history) GenerateAnimated(int seed, Vector2Int? forcedStart = null, Vector2Int? forcedDirection = null)
|
||||
{
|
||||
if (_config == null) return (null, null);
|
||||
|
||||
@@ -165,16 +182,32 @@ namespace Baba_yaga.GameSetup.MazeRework
|
||||
InitializeVisitedMap(grid, visited, rooms, width, depth);
|
||||
|
||||
// 4. Starting coordinates
|
||||
int startX = _config.startLocation.x;
|
||||
int startZ = _config.startLocation.y;
|
||||
int startX = forcedStart.HasValue ? forcedStart.Value.x : _config.startLocation.x;
|
||||
int startZ = forcedStart.HasValue ? forcedStart.Value.y : _config.startLocation.y;
|
||||
EnsureValidOddCoordinates(width, depth, ref startX, ref startZ);
|
||||
|
||||
// 5. Carve Corridors — algorithm fires back through the record callback
|
||||
// 5. Carve Corridors
|
||||
currentPhase = MazeAnimationPhase.Carving;
|
||||
visited[startX, startZ] = true;
|
||||
grid[startX, startZ] = MazeReworkCellType.Corridor;
|
||||
record(startX, startZ, MazeReworkCellType.Corridor, MazeCellHighlight.None); // DFS will highlight itself
|
||||
GetAlgorithm().Carve(grid, visited, startX, startZ, width, depth, rng, record);
|
||||
record(startX, startZ, MazeReworkCellType.Corridor, MazeCellHighlight.Evaluating);
|
||||
|
||||
IMazeReworkAlgorithm algorithm = GetAlgorithm();
|
||||
|
||||
if (forcedDirection.HasValue)
|
||||
{
|
||||
int fx = startX + forcedDirection.Value.x;
|
||||
int fz = startZ + forcedDirection.Value.y;
|
||||
if (fx >= 0 && fx < width && fz >= 0 && fz < depth && !visited[fx, fz])
|
||||
{
|
||||
visited[fx, fz] = true;
|
||||
grid[fx, fz] = MazeReworkCellType.Corridor;
|
||||
record(fx, fz, MazeReworkCellType.Corridor, MazeCellHighlight.Evaluating);
|
||||
algorithm.Carve(grid, visited, fx, fz, width, depth, rng, record);
|
||||
}
|
||||
}
|
||||
|
||||
algorithm.Carve(grid, visited, startX, startZ, width, depth, rng, record);
|
||||
|
||||
// 6. Hunt & Kill connecting pass
|
||||
currentPhase = MazeAnimationPhase.Connecting;
|
||||
@@ -184,9 +217,9 @@ namespace Baba_yaga.GameSetup.MazeRework
|
||||
currentPhase = MazeAnimationPhase.Loops;
|
||||
CarveLoops(grid, rng, width, depth, recordNoHighlight);
|
||||
|
||||
// 8. Start & End placement
|
||||
// 8. Place Start & End points (no highlighting needed for this step in animation)
|
||||
currentPhase = MazeAnimationPhase.StartEnd;
|
||||
PlaceStartAndEnd(grid, rooms, width, depth, recordNoHighlight);
|
||||
PlaceStartAndEnd(grid, rooms, width, depth, forcedStart, forcedDirection, recordNoHighlight);
|
||||
|
||||
return (grid, history);
|
||||
}
|
||||
@@ -436,29 +469,37 @@ namespace Baba_yaga.GameSetup.MazeRework
|
||||
}
|
||||
}
|
||||
|
||||
private void PlaceStartAndEnd(MazeReworkCellType[,] grid, List<Room> rooms, int width, int depth,
|
||||
private void PlaceStartAndEnd(MazeReworkCellType[,] grid, List<Room> rooms, int width, int depth, Vector2Int? forcedStart, Vector2Int? forcedDirection,
|
||||
Action<int, int, MazeReworkCellType> onCellChanged = null)
|
||||
{
|
||||
if (rooms != null && rooms.Count > 0)
|
||||
Vector2Int startPt;
|
||||
if (forcedStart.HasValue)
|
||||
{
|
||||
var startRoom = rooms[0];
|
||||
var startPt = startRoom.GetCenter();
|
||||
grid[startPt.x, startPt.y] = MazeReworkCellType.Start;
|
||||
onCellChanged?.Invoke(startPt.x, startPt.y, MazeReworkCellType.Start);
|
||||
|
||||
var endRoom = rooms[rooms.Count - 1];
|
||||
var endPt = endRoom.GetCenter();
|
||||
if (endPt == startPt && rooms.Count > 1) { endRoom = rooms[1]; endPt = endRoom.GetCenter(); }
|
||||
grid[endPt.x, endPt.y] = MazeReworkCellType.End;
|
||||
onCellChanged?.Invoke(endPt.x, endPt.y, MazeReworkCellType.End);
|
||||
startPt = forcedStart.Value;
|
||||
}
|
||||
else if (rooms != null && rooms.Count > 0)
|
||||
{
|
||||
startPt = rooms[0].GetCenter();
|
||||
}
|
||||
else
|
||||
{
|
||||
int sx = _config.startLocation.x, sz = _config.startLocation.y;
|
||||
EnsureValidOddCoordinates(width, depth, ref sx, ref sz);
|
||||
grid[sx, sz] = MazeReworkCellType.Start;
|
||||
onCellChanged?.Invoke(sx, sz, MazeReworkCellType.Start);
|
||||
startPt = new Vector2Int(sx, sz);
|
||||
}
|
||||
|
||||
grid[startPt.x, startPt.y] = MazeReworkCellType.Start;
|
||||
onCellChanged?.Invoke(startPt.x, startPt.y, MazeReworkCellType.Start);
|
||||
|
||||
Vector2Int endPt = startPt;
|
||||
if (rooms != null && rooms.Count > 0)
|
||||
{
|
||||
var endRoom = rooms[rooms.Count - 1];
|
||||
endPt = endRoom.GetCenter();
|
||||
if (endPt == startPt && rooms.Count > 1) { endPt = rooms[1].GetCenter(); }
|
||||
}
|
||||
else
|
||||
{
|
||||
int ex = width - 2, ez = depth - 2;
|
||||
EnsureValidOddCoordinates(width, depth, ref ex, ref ez);
|
||||
if (grid[ex, ez] == MazeReworkCellType.Wall)
|
||||
@@ -473,12 +514,36 @@ namespace Baba_yaga.GameSetup.MazeRework
|
||||
{ ex = tx; ez = tz; found = true; }
|
||||
}
|
||||
}
|
||||
if (ex != sx || ez != sz)
|
||||
{
|
||||
grid[ex, ez] = MazeReworkCellType.End;
|
||||
onCellChanged?.Invoke(ex, ez, MazeReworkCellType.End);
|
||||
}
|
||||
endPt = new Vector2Int(ex, ez);
|
||||
}
|
||||
|
||||
if (endPt == startPt)
|
||||
{
|
||||
// Fallback: find any path cell that isn't the start point, starting from the opposite corner
|
||||
int ex = 1, ez = 1;
|
||||
bool found = false;
|
||||
for (int r = 0; r < Mathf.Max(width, depth) && !found; r++)
|
||||
{
|
||||
for (int ddx = -r; ddx <= r && !found; ddx++)
|
||||
{
|
||||
for (int ddz = -r; ddz <= r && !found; ddz++)
|
||||
{
|
||||
int tx = ex + ddx, tz = ez + ddz;
|
||||
if (tx >= 0 && tx < width && tz >= 0 && tz < depth && IsPathCell(grid[tx, tz]))
|
||||
{
|
||||
if (tx != startPt.x || tz != startPt.y)
|
||||
{
|
||||
ex = tx; ez = tz; found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
endPt = new Vector2Int(ex, ez);
|
||||
}
|
||||
|
||||
grid[endPt.x, endPt.y] = MazeReworkCellType.End;
|
||||
onCellChanged?.Invoke(endPt.x, endPt.y, MazeReworkCellType.End);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Sirenix.OdinInspector;
|
||||
@@ -114,109 +115,158 @@ namespace Baba_yaga.GameSetup.MazeRework
|
||||
|
||||
if (animateGeneration && animator != null)
|
||||
{
|
||||
// Animated mode: generates floor 0 and replays the creation step-by-step
|
||||
int seed = config.useRandomSeed ? Random.Range(0, 1000000) : config.seed;
|
||||
var (grid, history) = generator.GenerateAnimated(seed);
|
||||
_grids.Add(grid);
|
||||
|
||||
BeginningWorldPosition = FindBeginningWorldPosition(grid);
|
||||
|
||||
animator.AnimateGeneration(history, grid, spawner, 0f, mazeContainer, () =>
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
Debug.Log($"[MazeReworkManager] Animation complete. Beginning world position: {BeginningWorldPosition}");
|
||||
});
|
||||
StartCoroutine(GenerateAndSpawnAnimatedRoutine(generator));
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[MazeReworkManager] Animation is only supported in Play Mode. Falling back to instantaneous generation.");
|
||||
GenerateInstantaneous(generator);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Standard instantaneous generation
|
||||
for (int i = 0; i < floorCount; i++)
|
||||
{
|
||||
int seed = config.useRandomSeed ? Random.Range(0, 1000000) : config.seed + i * 1000;
|
||||
var grid = generator.Generate(seed);
|
||||
_grids.Add(grid);
|
||||
}
|
||||
|
||||
// Connect floors with staircases if multiple floors are present
|
||||
if (floorCount > 1)
|
||||
{
|
||||
GenerateConnections();
|
||||
}
|
||||
|
||||
// Spawn prefabs for all floors
|
||||
for (int i = 0; i < floorCount; i++)
|
||||
{
|
||||
float yOffset = i * floorHeight;
|
||||
spawner.Spawn(_grids[i], yOffset, mazeContainer);
|
||||
}
|
||||
|
||||
// Compute and cache the world-space Beginning position from floor 0
|
||||
BeginningWorldPosition = FindBeginningWorldPosition(_grids[0]);
|
||||
Debug.Log($"[MazeReworkManager] Beginning world position set to: {BeginningWorldPosition}");
|
||||
GenerateInstantaneous(generator);
|
||||
}
|
||||
}
|
||||
|
||||
private void GenerateConnections()
|
||||
private IEnumerator GenerateAndSpawnAnimatedRoutine(MazeReworkGenerator generator)
|
||||
{
|
||||
int seed = config.useRandomSeed ? System.DateTime.Now.Millisecond : config.seed;
|
||||
System.Random rng = new System.Random(seed);
|
||||
|
||||
for (int i = 0; i < floorCount - 1; i++)
|
||||
Vector2Int? nextStartPos = null;
|
||||
Vector2Int? nextStartDir = null;
|
||||
for (int i = 0; i < floorCount; i++)
|
||||
{
|
||||
var currentFloor = _grids[i];
|
||||
var nextFloor = _grids[i + 1];
|
||||
|
||||
List<Vector2Int> possibleConnections = new List<Vector2Int>();
|
||||
|
||||
int width = config.width;
|
||||
int depth = config.depth;
|
||||
|
||||
for (int z = 1; z < depth - 1; z++)
|
||||
int seed = config.useRandomSeed ? System.Guid.NewGuid().GetHashCode() : config.seed + i * 1000;
|
||||
var (grid, history) = generator.GenerateAnimated(seed, nextStartPos, nextStartDir);
|
||||
|
||||
if (i > 0 && nextStartPos.HasValue)
|
||||
{
|
||||
for (int x = 1; x < width - 1; x++)
|
||||
{
|
||||
// A staircase requires path cells (corridors or rooms) to exist at the exact same x, z on both floors
|
||||
bool isCurrentFloorPath = IsPathCell(currentFloor[x, z]);
|
||||
bool isNextFloorPath = IsPathCell(nextFloor[x, z]);
|
||||
grid[nextStartPos.Value.x, nextStartPos.Value.y] = MazeReworkCellType.StairsDown;
|
||||
}
|
||||
|
||||
if (isCurrentFloorPath && isNextFloorPath)
|
||||
if (i < floorCount - 1)
|
||||
{
|
||||
Vector2Int endPos = new Vector2Int(-1, -1);
|
||||
for (int z = 0; z < config.depth; z++)
|
||||
{
|
||||
for (int x = 0; x < config.width; x++)
|
||||
{
|
||||
possibleConnections.Add(new Vector2Int(x, z));
|
||||
if (grid[x, z] == MazeReworkCellType.End) { endPos = new Vector2Int(x, z); break; }
|
||||
}
|
||||
if (endPos.x != -1) break;
|
||||
}
|
||||
if (endPos.x != -1)
|
||||
{
|
||||
grid[endPos.x, endPos.y] = MazeReworkCellType.StairsUp;
|
||||
nextStartPos = endPos;
|
||||
nextStartDir = GetSingleConnectionDirection(grid, endPos.x, endPos.y);
|
||||
}
|
||||
}
|
||||
|
||||
// Shuffle connections
|
||||
for (int k = possibleConnections.Count - 1; k > 0; k--)
|
||||
_grids.Add(grid);
|
||||
if (i == 0) BeginningWorldPosition = FindBeginningWorldPosition(grid);
|
||||
|
||||
bool floorAnimationComplete = false;
|
||||
float yOffset = i * floorHeight;
|
||||
animator.AnimateGeneration(history, grid, spawner, yOffset, mazeContainer, () =>
|
||||
{
|
||||
int idx = rng.Next(k + 1);
|
||||
var temp = possibleConnections[k];
|
||||
possibleConnections[k] = possibleConnections[idx];
|
||||
possibleConnections[idx] = temp;
|
||||
}
|
||||
floorAnimationComplete = true;
|
||||
});
|
||||
|
||||
int connectionsMade = 0;
|
||||
foreach (Vector2Int pos in possibleConnections)
|
||||
{
|
||||
if (connectionsMade >= connectionsPerFloor) break;
|
||||
|
||||
int x = pos.x;
|
||||
int z = pos.y;
|
||||
|
||||
// Set stair cells (stairs up on lower floor, stairs down on upper floor)
|
||||
currentFloor[x, z] = MazeReworkCellType.StairsUp;
|
||||
nextFloor[x, z] = MazeReworkCellType.StairsDown;
|
||||
|
||||
connectionsMade++;
|
||||
}
|
||||
yield return new WaitUntil(() => floorAnimationComplete);
|
||||
// Tiny pause before starting next floor
|
||||
yield return new WaitForSeconds(0.5f);
|
||||
}
|
||||
Debug.Log($"[MazeReworkManager] All floors animated! Beginning world position: {BeginningWorldPosition}");
|
||||
}
|
||||
|
||||
private void GenerateInstantaneous(MazeReworkGenerator generator)
|
||||
{
|
||||
Vector2Int? nextStartPos = null;
|
||||
Vector2Int? nextStartDir = null;
|
||||
for (int i = 0; i < floorCount; i++)
|
||||
{
|
||||
int seed = config.useRandomSeed ? System.Guid.NewGuid().GetHashCode() : config.seed + i * 1000;
|
||||
var grid = generator.Generate(seed, nextStartPos, nextStartDir);
|
||||
|
||||
// If this is not the first floor, replace the Start with StairsDown to connect to the floor below
|
||||
if (i > 0 && nextStartPos.HasValue)
|
||||
{
|
||||
grid[nextStartPos.Value.x, nextStartPos.Value.y] = MazeReworkCellType.StairsDown;
|
||||
}
|
||||
|
||||
// If there is a floor above this one, convert the End cell to a StairsUp
|
||||
if (i < floorCount - 1)
|
||||
{
|
||||
Vector2Int endPos = new Vector2Int(-1, -1);
|
||||
for (int z = 0; z < config.depth; z++)
|
||||
{
|
||||
for (int x = 0; x < config.width; x++)
|
||||
{
|
||||
if (grid[x, z] == MazeReworkCellType.End)
|
||||
{
|
||||
endPos = new Vector2Int(x, z);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (endPos.x != -1) break;
|
||||
}
|
||||
|
||||
if (endPos.x != -1)
|
||||
{
|
||||
grid[endPos.x, endPos.y] = MazeReworkCellType.StairsUp;
|
||||
nextStartPos = endPos;
|
||||
nextStartDir = GetSingleConnectionDirection(grid, endPos.x, endPos.y);
|
||||
}
|
||||
}
|
||||
|
||||
_grids.Add(grid);
|
||||
}
|
||||
|
||||
// Spawn prefabs for all floors
|
||||
for (int i = 0; i < floorCount; i++)
|
||||
{
|
||||
float yOffset = i * floorHeight;
|
||||
spawner.Spawn(_grids[i], yOffset, mazeContainer);
|
||||
}
|
||||
|
||||
// Compute and cache the world-space Beginning position from floor 0
|
||||
BeginningWorldPosition = FindBeginningWorldPosition(_grids[0]);
|
||||
Debug.Log($"[MazeReworkManager] Beginning world position set to: {BeginningWorldPosition}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
private bool IsPathCell(MazeReworkCellType type)
|
||||
{
|
||||
return type == MazeReworkCellType.Corridor ||
|
||||
type == MazeReworkCellType.Room ||
|
||||
type == MazeReworkCellType.Start ||
|
||||
type == MazeReworkCellType.End;
|
||||
type == MazeReworkCellType.End ||
|
||||
type == MazeReworkCellType.StairsDown ||
|
||||
type == MazeReworkCellType.StairsUp;
|
||||
}
|
||||
|
||||
private Vector2Int GetSingleConnectionDirection(MazeReworkCellType[,] grid, int cx, int cz)
|
||||
{
|
||||
int width = grid.GetLength(0);
|
||||
int depth = grid.GetLength(1);
|
||||
Vector2Int[] dirs = new Vector2Int[] { new Vector2Int(0, 1), new Vector2Int(1, 0), new Vector2Int(0, -1), new Vector2Int(-1, 0) };
|
||||
|
||||
foreach(var d in dirs)
|
||||
{
|
||||
int nx = cx + d.x;
|
||||
int nz = cz + d.y;
|
||||
if (nx >= 0 && nx < width && nz >= 0 && nz < depth)
|
||||
{
|
||||
if (IsPathCell(grid[nx, nz]))
|
||||
{
|
||||
return d;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Vector2Int(1, 0); // fallback
|
||||
}
|
||||
|
||||
private Vector3 FindBeginningWorldPosition(MazeReworkCellType[,] grid)
|
||||
|
||||
@@ -27,6 +27,8 @@ namespace Baba_yaga.GameSetup.MazeRework
|
||||
public GameObject beginningPrefab;
|
||||
[Tooltip("Prefab for the End cell (player exit point). Auto-rotates based on neighbors.")]
|
||||
public GameObject endPrefab;
|
||||
[Tooltip("Prefab for connecting to the next floor. Spawns on the lower floor and acts as a dead-end piece.")]
|
||||
public GameObject stairPrefab;
|
||||
|
||||
[Header("Preview Mode Settings (Phase 1)")]
|
||||
[Tooltip("If true, the spawner will only spawn simple preview blocks instead of full 3D modular pieces.")]
|
||||
@@ -58,6 +60,10 @@ namespace Baba_yaga.GameSetup.MazeRework
|
||||
public float beginningRotationOffset = 0f;
|
||||
[Tooltip("Rotation offset added to End prefab.")]
|
||||
public float endRotationOffset = 0f;
|
||||
[Tooltip("Rotation offset added to Stair prefab.")]
|
||||
public float stairRotationOffset = 0f;
|
||||
[Tooltip("Height offset added to Stair prefab.")]
|
||||
public float stairHeightOffset = 0f;
|
||||
|
||||
[Header("Spacing Settings")]
|
||||
[Tooltip("Physical distance between each grid cell center.")]
|
||||
@@ -70,8 +76,8 @@ namespace Baba_yaga.GameSetup.MazeRework
|
||||
public float Rotation;
|
||||
}
|
||||
|
||||
private readonly Dictionary<Vector2Int, SpawnedCellData> _spawnedGridCells = new Dictionary<Vector2Int, SpawnedCellData>();
|
||||
private readonly Dictionary<Vector2Int, GameObject> _spawnedHighlights = new Dictionary<Vector2Int, GameObject>();
|
||||
private readonly Dictionary<Vector3, SpawnedCellData> _spawnedGridCells = new Dictionary<Vector3, SpawnedCellData>();
|
||||
private readonly Dictionary<Vector3, GameObject> _spawnedHighlights = new Dictionary<Vector3, GameObject>();
|
||||
|
||||
private void Start()
|
||||
{
|
||||
@@ -169,7 +175,7 @@ namespace Baba_yaga.GameSetup.MazeRework
|
||||
{
|
||||
if (x < 0 || x >= width || z < 0 || z >= depth) return;
|
||||
|
||||
Vector2Int pos = new Vector2Int(x, z);
|
||||
Vector3 pos = new Vector3(x, yOffset, z);
|
||||
MazeReworkCellType type = grid[x, z];
|
||||
MazeCellHighlight hType = highlights != null ? highlights[x, z] : MazeCellHighlight.None;
|
||||
|
||||
@@ -237,6 +243,29 @@ namespace Baba_yaga.GameSetup.MazeRework
|
||||
targetRot = baseRot + endRotationOffset;
|
||||
targetName = "End";
|
||||
}
|
||||
else if (type == MazeReworkCellType.StairsUp)
|
||||
{
|
||||
if (stairPrefab != null)
|
||||
{
|
||||
(_, float baseRot) = GetModularPrefabAndRotation(grid, x, z, width, depth);
|
||||
targetPrefab = stairPrefab;
|
||||
targetRot = baseRot + stairRotationOffset;
|
||||
targetName = "StairConnection";
|
||||
yOffset += stairHeightOffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
(targetPrefab, targetRot) = GetModularPrefabAndRotation(grid, x, z, width, depth);
|
||||
targetName = $"{type}";
|
||||
}
|
||||
}
|
||||
else if (type == MazeReworkCellType.StairsDown)
|
||||
{
|
||||
// The stair prefab from the lower floor physically spans into this space.
|
||||
// We spawn NOTHING here, but it logically connects to the corridor network.
|
||||
targetPrefab = null;
|
||||
targetName = "StairsDownEmpty";
|
||||
}
|
||||
else
|
||||
{
|
||||
(targetPrefab, targetRot) = GetModularPrefabAndRotation(grid, x, z, width, depth);
|
||||
|
||||
Reference in New Issue
Block a user