Начал генерить генерацию комнат
This commit is contained in:
parent
e11ce6a0b0
commit
3ec3254efd
@ -1030,7 +1030,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!114 &47866426
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -4528,7 +4528,6 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::_Project.Scripts.UIPanel
|
||||
panel: {fileID: 474561344}
|
||||
playerController: {fileID: 0}
|
||||
--- !u!4 &217181662
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -4980,6 +4979,57 @@ Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 1672666446545052606, guid: 51510de34f82041149d25090ec962e10, type: 3}
|
||||
m_PrefabInstance: {fileID: 245437802}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &251508964
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 251508966}
|
||||
- component: {fileID: 251508965}
|
||||
m_Layer: 0
|
||||
m_Name: ProceduralLevelGenerator
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &251508965
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 251508964}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 05c6005aaf0a4e4ab66fd5a02bcde0e1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::_Project.Scripts.LevelGenerating.ProceduralLevelGenerator
|
||||
numberOfRooms: 7
|
||||
minRoomSize: {x: 20, y: 20}
|
||||
maxRoomSize: {x: 25, y: 50}
|
||||
tileSize: 2
|
||||
wallHeight: 8
|
||||
floorPrefab: {fileID: 4126418499162241421, guid: 8c2cf1e4657cb44caa148709f314b498, type: 3}
|
||||
wallPrefab: {fileID: 7999516613266399376, guid: 48978664cefe33676ae34ee1de87f594, type: 3}
|
||||
--- !u!4 &251508966
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 251508964}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -16.23501, y: -0, z: -2.7102}
|
||||
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!1001 &254672924
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -12042,7 +12092,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!114 &659897084
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -35796,7 +35846,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!136 &1903221283
|
||||
CapsuleCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -37882,7 +37932,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!114 &2002573463
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -41594,7 +41644,7 @@ Transform:
|
||||
m_GameObject: {fileID: 1033791869251556189}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -29.245607, y: 8.8, z: 13.558901}
|
||||
m_LocalPosition: {x: 0, y: 1, z: 0}
|
||||
m_LocalScale: {x: 0.5, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
@ -43418,7 +43468,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!4 &6199090829235347865 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: 7790047697380616352, guid: a08f59b910c8446a681d1932a4ffe269, type: 3}
|
||||
@ -45015,3 +45065,4 @@ SceneRoots:
|
||||
- {fileID: 2002573467}
|
||||
- {fileID: 659897088}
|
||||
- {fileID: 47866430}
|
||||
- {fileID: 251508966}
|
||||
|
||||
@ -12,7 +12,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3}
|
||||
m_Name: Bloom
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.Bloom
|
||||
active: 1
|
||||
active: 0
|
||||
skipIterations:
|
||||
m_OverrideState: 0
|
||||
m_Value: 1
|
||||
@ -80,7 +80,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: ccf1aba9553839d41ae37dd52e9ebcce, type: 3}
|
||||
m_Name: MotionBlur
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.MotionBlur
|
||||
active: 1
|
||||
active: 0
|
||||
mode:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
@ -105,7 +105,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 899c54efeace73346a0a16faa3afe726, type: 3}
|
||||
m_Name: Vignette
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.Vignette
|
||||
active: 1
|
||||
active: 0
|
||||
color:
|
||||
m_OverrideState: 1
|
||||
m_Value: {r: 1, g: 0, b: 0, a: 1}
|
||||
@ -133,7 +133,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 97c23e3b12dc18c42a140437e53d3951, type: 3}
|
||||
m_Name: Tonemapping
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.Tonemapping
|
||||
active: 1
|
||||
active: 0
|
||||
mode:
|
||||
m_OverrideState: 1
|
||||
m_Value: 1
|
||||
@ -173,7 +173,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 66f335fb1ffd8684294ad653bf1c7564, type: 3}
|
||||
m_Name: ColorAdjustments
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.ColorAdjustments
|
||||
active: 1
|
||||
active: 0
|
||||
postExposure:
|
||||
m_OverrideState: 1
|
||||
m_Value: 0.18
|
||||
|
||||
8
Assets/_Project/Materials.meta
Normal file
8
Assets/_Project/Materials.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d19fc30db77e34656a0813764657b7ed
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
139
Assets/_Project/Materials/New Material.mat
Normal file
139
Assets/_Project/Materials/New Material.mat
Normal file
@ -0,0 +1,139 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &-1320640688500226478
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion
|
||||
version: 10
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 8
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: New Material
|
||||
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
|
||||
m_Parent: {fileID: 0}
|
||||
m_ModifiedSerializedProperties: 0
|
||||
m_ValidKeywords: []
|
||||
m_InvalidKeywords: []
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap:
|
||||
RenderType: Opaque
|
||||
disabledShaderPasses:
|
||||
- MOTIONVECTORS
|
||||
m_LockedProperties:
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BaseMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BumpMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SpecGlossMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_Lightmaps:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_LightmapsInd:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- unity_ShadowMasks:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Ints: []
|
||||
m_Floats:
|
||||
- _AddPrecomputedVelocity: 0
|
||||
- _AlphaClip: 0
|
||||
- _AlphaToMask: 0
|
||||
- _Blend: 0
|
||||
- _BlendModePreserveSpecular: 1
|
||||
- _BumpScale: 1
|
||||
- _ClearCoatMask: 0
|
||||
- _ClearCoatSmoothness: 0
|
||||
- _Cull: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DetailAlbedoMapScale: 1
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _DstBlendAlpha: 0
|
||||
- _EnvironmentReflections: 1
|
||||
- _GlossMapScale: 0
|
||||
- _Glossiness: 0
|
||||
- _GlossyReflections: 0
|
||||
- _Metallic: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.005
|
||||
- _QueueOffset: 0
|
||||
- _ReceiveShadows: 1
|
||||
- _ScreenSpaceReflections: 1
|
||||
- _ScreenSpaceReflectionsContributeTransparent: 1
|
||||
- _Smoothness: 0.5
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _SrcBlendAlpha: 1
|
||||
- _Surface: 0
|
||||
- _WorkflowMode: 1
|
||||
- _XRMotionVectorsPass: 1
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _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
|
||||
8
Assets/_Project/Materials/New Material.mat.meta
Normal file
8
Assets/_Project/Materials/New Material.mat.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 637ebd084daee042dacc83d02257fbce
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 2100000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
114
Assets/_Project/Prefabs/Floor.prefab
Normal file
114
Assets/_Project/Prefabs/Floor.prefab
Normal file
@ -0,0 +1,114 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &4126418499162241421
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8315090919281749943}
|
||||
- component: {fileID: 6982278494683591372}
|
||||
- component: {fileID: 5535134034144645609}
|
||||
- component: {fileID: 3576149367622495373}
|
||||
m_Layer: 3
|
||||
m_Name: Floor
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8315090919281749943
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4126418499162241421}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -15.47951, y: 0, z: -2.69876}
|
||||
m_LocalScale: {x: 2, y: 0.2, z: 2}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &6982278494683591372
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4126418499162241421}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &5535134034144645609
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4126418499162241421}
|
||||
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: 637ebd084daee042dacc83d02257fbce, 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!65 &3576149367622495373
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4126418499162241421}
|
||||
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: 3
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
7
Assets/_Project/Prefabs/Floor.prefab.meta
Normal file
7
Assets/_Project/Prefabs/Floor.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c2cf1e4657cb44caa148709f314b498
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
114
Assets/_Project/Prefabs/Wall.prefab
Normal file
114
Assets/_Project/Prefabs/Wall.prefab
Normal file
@ -0,0 +1,114 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &7999516613266399376
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3335684005817152971}
|
||||
- component: {fileID: 7616201814693462644}
|
||||
- component: {fileID: 5556038547321235290}
|
||||
- component: {fileID: 6613210292542525527}
|
||||
m_Layer: 0
|
||||
m_Name: Wall
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &3335684005817152971
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7999516613266399376}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -16.23501, y: -0, z: -2.7102}
|
||||
m_LocalScale: {x: 2, y: 8, z: 0.2}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!33 &7616201814693462644
|
||||
MeshFilter:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7999516613266399376}
|
||||
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!23 &5556038547321235290
|
||||
MeshRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7999516613266399376}
|
||||
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: 31321ba15b8f8eb4c954353edc038b1d, 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!65 &6613210292542525527
|
||||
BoxCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7999516613266399376}
|
||||
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: 3
|
||||
m_Size: {x: 1, y: 1, z: 1}
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
7
Assets/_Project/Prefabs/Wall.prefab.meta
Normal file
7
Assets/_Project/Prefabs/Wall.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 48978664cefe33676ae34ee1de87f594
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
3
Assets/_Project/Scripts/LevelGenerating.meta
Normal file
3
Assets/_Project/Scripts/LevelGenerating.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c10e59cdfe784e6ba3ba36eccef0351f
|
||||
timeCreated: 1790254451
|
||||
@ -0,0 +1,272 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class ProceduralLevelGenerator : MonoBehaviour
|
||||
{
|
||||
[Header("Настройки генерации")]
|
||||
public int numberOfRooms = 8;
|
||||
public Vector2Int minRoomSize = new Vector2Int(5, 5);
|
||||
public Vector2Int maxRoomSize = new Vector2Int(12, 12);
|
||||
public float tileSize = 2f;
|
||||
public float wallHeight = 8f; // Ты указал высоту 8
|
||||
|
||||
[Header("Префабы строительных блоков")]
|
||||
public GameObject floorPrefab;
|
||||
public GameObject wallPrefab;
|
||||
|
||||
// Структура клетки
|
||||
private class Cell
|
||||
{
|
||||
public int roomID;
|
||||
public int floorHeight;
|
||||
}
|
||||
|
||||
// Структура для прохода (двери)
|
||||
private class Passage
|
||||
{
|
||||
public Vector2Int cellA; // Клетка из одной комнаты
|
||||
public Vector2Int cellB; // Клетка из другой комнаты
|
||||
}
|
||||
|
||||
private Dictionary<Vector2Int, Cell> levelMap = new Dictionary<Vector2Int, Cell>();
|
||||
private List<RectInt> rooms = new List<RectInt>();
|
||||
|
||||
// Список всех прорубленных проходов
|
||||
private List<Passage> passages = new List<Passage>();
|
||||
|
||||
void Start()
|
||||
{
|
||||
GenerateLayout();
|
||||
ApplyVerticality();
|
||||
BuildMesh();
|
||||
}
|
||||
|
||||
void GenerateLayout()
|
||||
{
|
||||
// --- ШАГ 1: Стартовая комната (10x10) ---
|
||||
int startWidth = 10;
|
||||
int startHeight = 10;
|
||||
int startX = -startWidth / 2;
|
||||
int startY = -startHeight / 2;
|
||||
|
||||
RectInt startRoom = new RectInt(startX, startY, startWidth, startHeight);
|
||||
rooms.Add(startRoom);
|
||||
SaveRoomToMap(startRoom, 0);
|
||||
|
||||
// --- ШАГ 2: Первая комната с врагами ---
|
||||
int firstEnemyWidth = Random.Range(minRoomSize.x, maxRoomSize.x);
|
||||
int firstEnemyHeight = Random.Range(minRoomSize.y, maxRoomSize.y);
|
||||
|
||||
int firstEnemyX = startRoom.x + Random.Range(-firstEnemyWidth / 2, startRoom.width - firstEnemyWidth / 2);
|
||||
int firstEnemyY = startRoom.yMax;
|
||||
|
||||
RectInt firstEnemyRoom = new RectInt(firstEnemyX, firstEnemyY, firstEnemyWidth, firstEnemyHeight);
|
||||
rooms.Add(firstEnemyRoom);
|
||||
SaveRoomToMap(firstEnemyRoom, 1);
|
||||
|
||||
// ПРОРУБАЕМ ПРОХОД между стартовой и первой вражеской комнатой
|
||||
CreatePassage(startRoom, firstEnemyRoom);
|
||||
|
||||
// --- ШАГ 3: Остальные комнаты ---
|
||||
for (int i = 2; i < numberOfRooms; i++)
|
||||
{
|
||||
bool roomPlaced = false;
|
||||
int attempts = 0;
|
||||
|
||||
while (!roomPlaced && attempts < 50)
|
||||
{
|
||||
attempts++;
|
||||
|
||||
// Выбираем случайную комнату (кроме стартовой)
|
||||
int baseRoomIndex = Random.Range(1, rooms.Count);
|
||||
RectInt baseRoom = rooms[baseRoomIndex];
|
||||
|
||||
int newWidth = Random.Range(minRoomSize.x, maxRoomSize.x);
|
||||
int newHeight = Random.Range(minRoomSize.y, maxRoomSize.y);
|
||||
|
||||
int side = Random.Range(0, 4);
|
||||
RectInt newRoom = new RectInt();
|
||||
|
||||
if (side == 0) // Север
|
||||
newRoom = new RectInt(baseRoom.x + Random.Range(-newWidth/2, baseRoom.width - newWidth/2), baseRoom.yMax, newWidth, newHeight);
|
||||
else if (side == 1) // Юг
|
||||
newRoom = new RectInt(baseRoom.x + Random.Range(-newWidth/2, baseRoom.width - newWidth/2), baseRoom.yMin - newHeight, newWidth, newHeight);
|
||||
else if (side == 2) // Восток
|
||||
newRoom = new RectInt(baseRoom.xMax, baseRoom.y + Random.Range(-newHeight/2, baseRoom.height - newHeight/2), newWidth, newHeight);
|
||||
else if (side == 3) // Запад
|
||||
newRoom = new RectInt(baseRoom.xMin - newWidth, baseRoom.y + Random.Range(-newHeight/2, baseRoom.height - newHeight/2), newWidth, newHeight);
|
||||
|
||||
if (!CheckOverlap(newRoom))
|
||||
{
|
||||
rooms.Add(newRoom);
|
||||
SaveRoomToMap(newRoom, i);
|
||||
|
||||
// ПРОРУБАЕМ ПРОХОД между базовой комнатой и новой
|
||||
CreatePassage(baseRoom, newRoom);
|
||||
|
||||
roomPlaced = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Выбирает одну случайную общую стену между двумя комнатами и делает там проход
|
||||
void CreatePassage(RectInt room1, RectInt room2)
|
||||
{
|
||||
List<Vector2Int[]> potentialPassages = new List<Vector2Int[]>();
|
||||
|
||||
// Проходим по всем клеткам первой комнаты
|
||||
for (int x = room1.xMin; x < room1.xMax; x++)
|
||||
{
|
||||
for (int y = room1.yMin; y < room1.yMax; y++)
|
||||
{
|
||||
Vector2Int cellA = new Vector2Int(x, y);
|
||||
Vector2Int[] dirs = { Vector2Int.up, Vector2Int.down, Vector2Int.left, Vector2Int.right };
|
||||
|
||||
// Проверяем соседей
|
||||
foreach (var dir in dirs)
|
||||
{
|
||||
Vector2Int cellB = cellA + dir;
|
||||
// Если соседняя клетка находится во второй комнате — это потенциальная дверь!
|
||||
if (cellB.x >= room2.xMin && cellB.x < room2.xMax &&
|
||||
cellB.y >= room2.yMin && cellB.y < room2.yMax)
|
||||
{
|
||||
potentialPassages.Add(new Vector2Int[] { cellA, cellB });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Если нашли точки соприкосновения, берем ОДНУ случайную и делаем там проход
|
||||
if (potentialPassages.Count > 0)
|
||||
{
|
||||
Vector2Int[] chosen = potentialPassages[Random.Range(0, potentialPassages.Count)];
|
||||
passages.Add(new Passage { cellA = chosen[0], cellB = chosen[1] });
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyVerticality()
|
||||
{
|
||||
for (int i = 1; i < rooms.Count; i++)
|
||||
{
|
||||
RectInt room = rooms[i];
|
||||
|
||||
if (Random.value > 0.5f)
|
||||
{
|
||||
int platformWidth = room.width / 2;
|
||||
int platformHeight = room.height / 2;
|
||||
int offsetX = Random.Range(1, room.width - platformWidth - 1);
|
||||
int offsetY = Random.Range(1, room.height - platformHeight - 1);
|
||||
|
||||
for (int x = 0; x < platformWidth; x++)
|
||||
{
|
||||
for (int y = 0; y < platformHeight; y++)
|
||||
{
|
||||
Vector2Int pos = new Vector2Int(room.x + offsetX + x, room.y + offsetY + y);
|
||||
if (levelMap.ContainsKey(pos))
|
||||
{
|
||||
levelMap[pos].floorHeight = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BuildMesh()
|
||||
{
|
||||
Vector2Int[] directions = { Vector2Int.up, Vector2Int.down, Vector2Int.right, Vector2Int.left };
|
||||
float[] wallRotations = { 0f, 180f, 90f, -90f };
|
||||
|
||||
foreach (var kvp in levelMap)
|
||||
{
|
||||
Vector2Int pos = kvp.Key;
|
||||
Cell cell = kvp.Value;
|
||||
|
||||
// Вычисляем высоту (чтобы балконы были логичной высоты, умножаем на половину высоты стены)
|
||||
float worldHeight = cell.floorHeight * (wallHeight * 0.5f);
|
||||
|
||||
Vector3 floorPos = new Vector3(pos.x * tileSize, worldHeight, pos.y * tileSize);
|
||||
GameObject floor = Instantiate(floorPrefab, floorPos, Quaternion.identity, this.transform);
|
||||
floor.name = $"Floor_{pos.x}_{pos.y}";
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
Vector2Int neighborPos = pos + directions[i];
|
||||
bool needsWall = false;
|
||||
|
||||
if (!levelMap.ContainsKey(neighborPos))
|
||||
{
|
||||
// Соседа нет -> глухая внешняя стена
|
||||
needsWall = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Cell neighborCell = levelMap[neighborPos];
|
||||
|
||||
if (neighborCell.roomID != cell.roomID)
|
||||
{
|
||||
// Это граница двух комнат. Проверяем, есть ли здесь проход.
|
||||
if (IsPassage(pos, neighborPos))
|
||||
{
|
||||
needsWall = false; // ПРОПУСКАЕМ СТЕНУ (оставляем дыру для двери)
|
||||
}
|
||||
else
|
||||
{
|
||||
needsWall = true; // Ставим стену
|
||||
}
|
||||
}
|
||||
else if (neighborCell.floorHeight > cell.floorHeight)
|
||||
{
|
||||
// Сосед выше, нужна стена-ступенька внутри комнаты
|
||||
needsWall = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (needsWall)
|
||||
{
|
||||
Vector3 wallPos = floorPos + new Vector3(directions[i].x * (tileSize / 2), wallHeight / 2, directions[i].y * (tileSize / 2));
|
||||
GameObject wall = Instantiate(wallPrefab, wallPos, Quaternion.Euler(0, wallRotations[i], 0), this.transform);
|
||||
wall.name = $"Wall_{pos.x}_{pos.y}_{i}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Проверяет, является ли граница между двумя клетками проходом
|
||||
bool IsPassage(Vector2Int a, Vector2Int b)
|
||||
{
|
||||
foreach (var p in passages)
|
||||
{
|
||||
if ((p.cellA == a && p.cellB == b) || (p.cellA == b && p.cellB == a))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void SaveRoomToMap(RectInt room, int id)
|
||||
{
|
||||
for (int x = room.xMin; x < room.xMax; x++)
|
||||
{
|
||||
for (int y = room.yMin; y < room.yMax; y++)
|
||||
{
|
||||
levelMap[new Vector2Int(x, y)] = new Cell { roomID = id, floorHeight = 0 };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CheckOverlap(RectInt newRoom)
|
||||
{
|
||||
foreach (RectInt room in rooms)
|
||||
{
|
||||
if (newRoom.xMin < room.xMax && newRoom.xMax > room.xMin &&
|
||||
newRoom.yMin < room.yMax && newRoom.yMax > room.yMin)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 05c6005aaf0a4e4ab66fd5a02bcde0e1
|
||||
timeCreated: 1790254468
|
||||
Loading…
Reference in New Issue
Block a user