This commit is contained in:
haitem 2022-01-29 20:12:18 +01:00
commit 41874041fa
17 changed files with 7302 additions and 104 deletions

View File

@ -55,7 +55,6 @@ Material:
m_Texture: {fileID: 0} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats: m_Floats:
- _BumpScale: 1 - _BumpScale: 1
- _Cutoff: 0.5 - _Cutoff: 0.5
@ -76,4 +75,3 @@ Material:
m_Colors: m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1} - _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 1.2926722, b: 5.0387836, a: 1} - _EmissionColor: {r: 0, g: 1.2926722, b: 5.0387836, a: 1}
m_BuildTextureStacks: []

View File

@ -55,7 +55,6 @@ Material:
m_Texture: {fileID: 0} m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1} m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0} m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats: m_Floats:
- _BumpScale: 1 - _BumpScale: 1
- _Cutoff: 0.5 - _Cutoff: 0.5
@ -76,4 +75,3 @@ Material:
m_Colors: m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1} - _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 5.0387836, g: 0, b: 0, a: 1} - _EmissionColor: {r: 5.0387836, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []

View File

@ -0,0 +1,281 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2394897576110124403
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2394897576110124412}
- component: {fileID: 2394897576110124415}
- component: {fileID: 2394897576110124414}
- component: {fileID: 2394897576110124413}
m_Layer: 0
m_Name: base
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2394897576110124412
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2394897576110124403}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 2394897577413455489}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &2394897576110124415
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2394897576110124403}
m_Mesh: {fileID: 4300000, guid: efabf3165503c56478281eb803c0ba18, type: 3}
--- !u!23 &2394897576110124414
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2394897576110124403}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: e964da8af4e60c0418a523797c8cc478, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!64 &2394897576110124413
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2394897576110124403}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_Mesh: {fileID: 4300000, guid: efabf3165503c56478281eb803c0ba18, type: 3}
--- !u!1 &2394897577269885453
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2394897577269885454}
- component: {fileID: 2394897577269885448}
- component: {fileID: 2394897577269885455}
m_Layer: 2
m_Name: emission
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2394897577269885454
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2394897577269885453}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 3, z: -2.375}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 2394897577413455489}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &2394897577269885448
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2394897577269885453}
m_Mesh: {fileID: 4300000, guid: 0212a4f898e085043b1c27564004dfc3, type: 3}
--- !u!23 &2394897577269885455
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2394897577269885453}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: a7fd394a85158734e9c5317abd59001b, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!1 &2394897577413455488
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2394897577413455489}
m_Layer: 0
m_Name: Gaint Freaking Magnet
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2394897577413455489
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2394897577413455488}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -18.8}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2394897576110124412}
- {fileID: 2394897577269885454}
- {fileID: 2394897577479467192}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2394897577479467199
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2394897577479467192}
- component: {fileID: 2394897577479467194}
- component: {fileID: 2394897577479467193}
m_Layer: 0
m_Name: emission
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2394897577479467192
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2394897577479467199}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 3, z: 2.375}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 2394897577413455489}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &2394897577479467194
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2394897577479467199}
m_Mesh: {fileID: 4300000, guid: 8f04e1855fd77a044b406d29627e7f2a, type: 3}
--- !u!23 &2394897577479467193
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2394897577479467199}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: a53e8d521405290428f80761527e56e5, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1348a4eeda762ae4db83cd873efb4c44
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -123,6 +123,11 @@ NavMeshSettings:
debug: debug:
m_Flags: 0 m_Flags: 0
m_NavMeshData: {fileID: 0} m_NavMeshData: {fileID: 0}
--- !u!1 &250075900 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 3244356566819001084, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
m_PrefabInstance: {fileID: 1287430439}
m_PrefabAsset: {fileID: 0}
--- !u!1 &327689120 --- !u!1 &327689120
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -154,7 +159,7 @@ Transform:
m_Children: m_Children:
- {fileID: 708734976} - {fileID: 708734976}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &327689122 --- !u!114 &327689122
MonoBehaviour: MonoBehaviour:
@ -173,7 +178,7 @@ MonoBehaviour:
- {fileID: 8768991388683709947, guid: 99c4e582c7358f346ab00dae4ae956f9, type: 3} - {fileID: 8768991388683709947, guid: 99c4e582c7358f346ab00dae4ae956f9, type: 3}
- {fileID: 6650340373999088090, guid: 76b3e3235b07ca04f91c9b020603e1dd, type: 3} - {fileID: 6650340373999088090, guid: 76b3e3235b07ca04f91c9b020603e1dd, type: 3}
spawnedLevelBlocks: [] spawnedLevelBlocks: []
player: {fileID: 1621231496} player: {fileID: 250075900}
lastBlock: {fileID: 708734972} lastBlock: {fileID: 708734972}
--- !u!1 &705507993 --- !u!1 &705507993
GameObject: GameObject:
@ -366,11 +371,63 @@ Transform:
m_Father: {fileID: 327689121} m_Father: {fileID: 327689121}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1621231496 stripped --- !u!1001 &1287430439
GameObject: PrefabInstance:
m_CorrespondingSourceObject: {fileID: 3244356566819001084, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3} m_ObjectHideFlags: 0
m_PrefabInstance: {fileID: 1953646381} serializedVersion: 2
m_PrefabAsset: {fileID: 0} m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3244356567786994344, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_Name
value: Player
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalPosition.y
value: 1.95
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
--- !u!1 &1802677907 --- !u!1 &1802677907
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -420,64 +477,3 @@ Transform:
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 2 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1953646381
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3244356566819001085, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalPosition.z
value: 0.7
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994344, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_Name
value: Player
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalPosition.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3244356567786994345, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}

View File

@ -30,7 +30,7 @@ public class ProceduralGeneration : MonoBehaviour
int pieceCount = 10; int pieceCount = 10;
float radius = (pieceCount / 2) * 2; float radius = (pieceCount / 2) * 2;
float angle = 360f / (float)pieceCount; float angle = 360f / (float)pieceCount;
Vector3 centerPoint = new Vector3(lastObject.transform.position.x, (lastObject.transform.position.y + radius), lastObject.transform.position.z + 2.0f); Vector3 centerPoint = new Vector3(lastObject.transform.position.x, (lastObject.transform.position.y + radius), lastObject.transform.position.z + 3.0f);
float heightOffset = radius; float heightOffset = radius;
@ -49,28 +49,30 @@ public class ProceduralGeneration : MonoBehaviour
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
int maxNumberOfBlock = 100; int maxNumberOfBlock = 200;
Vector3 playerPosition = this.player.transform.position; Vector3 playerPosition = this.player.transform.position;
float distance = Vector3.Distance(this.spawnedLevelBlocks[0].transform.position, playerPosition);
Debug.Log("Index" + 0); Debug.Log("Index" + 0);
if (distance > 10.0f || this.spawnedLevelBlocks.Count >= maxNumberOfBlock + 5) for (var i = 0; i < this.spawnedLevelBlocks.Count; i++)
{ {
Destroy(this.spawnedLevelBlocks[0]); float distance = Vector3.Distance(this.spawnedLevelBlocks[i].transform.position, playerPosition);
this.spawnedLevelBlocks.Remove(this.spawnedLevelBlocks[0]); if (distance > 10.0f && this.spawnedLevelBlocks.Count >= maxNumberOfBlock)
spavnetobjectIndex++; {
Destroy(this.spawnedLevelBlocks[i]);
this.spawnedLevelBlocks.Remove(this.spawnedLevelBlocks[i]);
spavnetobjectIndex++;
}
else
{
break;
}
} }
if (this.spawnedLevelBlocks.Count <= maxNumberOfBlock) if (this.spawnedLevelBlocks.Count <= maxNumberOfBlock)
{ {
MeshFilter meshfilter = lastBlock.GetComponent<MeshFilter>();
Bounds bounds = meshfilter.mesh.bounds;
float scale = meshfilter.transform.localScale.x;
Bounds b = new Bounds(bounds.center * scale, bounds.size * scale);
int blockToSpawn = Random.Range(0, levelBlocks.Count - 1); int blockToSpawn = Random.Range(0, levelBlocks.Count - 1);
GameObject instantiatedGameObject; GameObject instantiatedGameObject;
@ -100,9 +102,17 @@ public class ProceduralGeneration : MonoBehaviour
if ((blockToSpawn > -1 && (blockToSpawn < (levelBlocks.Count - 1)))) if ((blockToSpawn > -1 && (blockToSpawn < (levelBlocks.Count - 1))))
{ {
MeshFilter meshfilter = this.lastBlock.GetComponent<MeshFilter>();
Bounds bounds = meshfilter.mesh.bounds;
float scale = meshfilter.transform.localScale.x;
Bounds b = new Bounds(bounds.center * scale, bounds.size * scale);
blockObjToSpawn = levelBlocks[blockToSpawn]; blockObjToSpawn = levelBlocks[blockToSpawn];
instantiatedGameObject = Instantiate(blockObjToSpawn, new Vector3(lastBlock.transform.position.x, lastBlock.transform.position.y, lastBlock.transform.position.y + (b.size.z + 1.0f)), (Quaternion.identity)); Vector3 nextBlockLocation = new Vector3(this.lastBlock.transform.position.x, this.lastBlock.transform.position.y, this.lastBlock.transform.position.z + b.size.z + 1.0f);
instantiatedGameObject = Instantiate(blockObjToSpawn, nextBlockLocation, (Quaternion.identity));
this.spawnedLevelBlocks.Add(instantiatedGameObject); this.spawnedLevelBlocks.Add(instantiatedGameObject);
} }
else else
{ {
@ -116,9 +126,9 @@ public class ProceduralGeneration : MonoBehaviour
} }
Debug.Log("Spawn" + blockToSpawn); Debug.Log("Spawn" + blockToSpawn);
this.lastBlock = instantiatedGameObject;
this.lastBlockPrefab = blockObjToSpawn;
lastBlock = instantiatedGameObject;
lastBlockPrefab = blockObjToSpawn;
} }
} }
} }

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: aafca3775bc8cf24f807f6810b06d4a1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a9165c0fd3ffd1e46acd02265980d8f5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,99 @@
fileFormatVersion: 2
guid: efabf3165503c56478281eb803c0ba18
ModelImporter:
serializedVersion: 23
fileIDToRecycleName:
100000: default
100002: //RootNode
400000: default
400002: //RootNode
2100000: defaultMat
2300000: default
3300000: default
4300000: default
externalObjects: {}
materials:
importMaterials: 1
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 1
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
previousCalculatedGlobalScale: 1
hasPreviousCalculatedGlobalScale: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
importAnimation: 1
copyAvatar: 0
humanDescription:
serializedVersion: 2
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 0
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a2ed28edbbcd1244291cf8382904aa3c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,99 @@
fileFormatVersion: 2
guid: 0212a4f898e085043b1c27564004dfc3
ModelImporter:
serializedVersion: 23
fileIDToRecycleName:
100000: default
100002: //RootNode
400000: default
400002: //RootNode
2100000: defaultMat
2300000: default
3300000: default
4300000: default
externalObjects: {}
materials:
importMaterials: 1
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 1
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
previousCalculatedGlobalScale: 1
hasPreviousCalculatedGlobalScale: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
importAnimation: 1
copyAvatar: 0
humanDescription:
serializedVersion: 2
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 0
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7d8657ebf51ae0846908014ef917f93f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,99 @@
fileFormatVersion: 2
guid: 8f04e1855fd77a044b406d29627e7f2a
ModelImporter:
serializedVersion: 23
fileIDToRecycleName:
100000: default
100002: //RootNode
400000: default
400002: //RootNode
2100000: defaultMat
2300000: default
3300000: default
4300000: default
externalObjects: {}
materials:
importMaterials: 1
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 1
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
optimizeMeshForGPU: 1
keepQuads: 0
weldVertices: 1
preserveHierarchy: 0
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVPackMargin: 4
useFileScale: 1
previousCalculatedGlobalScale: 1
hasPreviousCalculatedGlobalScale: 0
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
importAnimation: 1
copyAvatar: 0
humanDescription:
serializedVersion: 2
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
animationType: 0
humanoidOversampling: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -74,7 +74,7 @@ MonoBehaviour:
m_MinSize: {x: 100, y: 200} m_MinSize: {x: 100, y: 200}
m_MaxSize: {x: 8096, y: 16192} m_MaxSize: {x: 8096, y: 16192}
vertical: 1 vertical: 1
controlID: 106 controlID: 91
--- !u!114 &4 --- !u!114 &4
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 52 m_ObjectHideFlags: 52
@ -196,7 +196,7 @@ MonoBehaviour:
m_MinSize: {x: 300, y: 300} m_MinSize: {x: 300, y: 300}
m_MaxSize: {x: 24288, y: 24288} m_MaxSize: {x: 24288, y: 24288}
vertical: 0 vertical: 0
controlID: 136 controlID: 51
--- !u!114 &9 --- !u!114 &9
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 52 m_ObjectHideFlags: 52
@ -221,7 +221,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 300} m_MinSize: {x: 200, y: 300}
m_MaxSize: {x: 16192, y: 24288} m_MaxSize: {x: 16192, y: 24288}
vertical: 1 vertical: 1
controlID: 137 controlID: 52
--- !u!114 &10 --- !u!114 &10
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 52 m_ObjectHideFlags: 52
@ -246,7 +246,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 200} m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 16192, y: 16192} m_MaxSize: {x: 16192, y: 16192}
vertical: 0 vertical: 0
controlID: 138 controlID: 53
--- !u!114 &11 --- !u!114 &11
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 52 m_ObjectHideFlags: 52
@ -552,9 +552,9 @@ MonoBehaviour:
m_PlayAudio: 0 m_PlayAudio: 0
m_AudioPlay: 0 m_AudioPlay: 0
m_Position: m_Position:
m_Target: {x: -35.567223, y: -34.52502, z: 84.8776} m_Target: {x: 4.1197705, y: 4.1805277, z: 0.003569603}
speed: 2 speed: 2
m_Value: {x: -35.567223, y: -34.52502, z: 84.8776} m_Value: {x: 4.1197705, y: 4.1805277, z: 0.003569603}
m_RenderMode: 0 m_RenderMode: 0
m_CameraMode: m_CameraMode:
drawMode: 0 drawMode: 0
@ -601,13 +601,13 @@ MonoBehaviour:
m_GridAxis: 1 m_GridAxis: 1
m_gridOpacity: 0.5 m_gridOpacity: 0.5
m_Rotation: m_Rotation:
m_Target: {x: -0.23456672, y: 0.2648467, z: -0.06657946, w: -0.93297315} m_Target: {x: -0.24263431, y: 0.20393051, z: -0.05224936, w: -0.9470325}
speed: 2 speed: 2
m_Value: {x: -0.23596154, y: 0.26474166, z: -0.066975445, w: -0.932603} m_Value: {x: -0.24270518, y: 0.2025037, z: -0.051883806, w: -0.9473091}
m_Size: m_Size:
m_Target: 70.38889 m_Target: 9.460844
speed: 2 speed: 2
m_Value: 39.39149 m_Value: 70.38889
m_Ortho: m_Ortho:
m_Target: 0 m_Target: 0
speed: 2 speed: 2
@ -665,7 +665,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
m_SelectedIDs: m_SelectedIDs:
m_LastClickedID: 0 m_LastClickedID: 0
m_ExpandedIDs: aaf9fffffefaffff784c0000 m_ExpandedIDs: d0faffff
m_RenameOverlay: m_RenameOverlay:
m_UserAcceptedRename: 0 m_UserAcceptedRename: 0
m_Name: m_Name:
@ -863,9 +863,9 @@ MonoBehaviour:
m_IsLocked: 0 m_IsLocked: 0
m_FolderTreeState: m_FolderTreeState:
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
m_SelectedIDs: fc4e0000 m_SelectedIDs: 1e520000
m_LastClickedID: 20220 m_LastClickedID: 21022
m_ExpandedIDs: 00000000ee4e000000ca9a3b m_ExpandedIDs: 00000000025200000452000000ca9a3b
m_RenameOverlay: m_RenameOverlay:
m_UserAcceptedRename: 0 m_UserAcceptedRename: 0
m_Name: m_Name:
@ -893,7 +893,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0} scrollPos: {x: 0, y: 0}
m_SelectedIDs: m_SelectedIDs:
m_LastClickedID: 0 m_LastClickedID: 0
m_ExpandedIDs: 00000000ee4e0000 m_ExpandedIDs: 000000000252000004520000
m_RenameOverlay: m_RenameOverlay:
m_UserAcceptedRename: 0 m_UserAcceptedRename: 0
m_Name: m_Name:
@ -920,7 +920,7 @@ MonoBehaviour:
m_ListAreaState: m_ListAreaState:
m_SelectedInstanceIDs: m_SelectedInstanceIDs:
m_LastClickedInstanceID: 0 m_LastClickedInstanceID: 0
m_HadKeyboardFocusLastEvent: 1 m_HadKeyboardFocusLastEvent: 0
m_ExpandedInstanceIDs: c6230000ae4f0000ca4f0000ac510000b2510000 m_ExpandedInstanceIDs: c6230000ae4f0000ca4f0000ac510000b2510000
m_RenameOverlay: m_RenameOverlay:
m_UserAcceptedRename: 0 m_UserAcceptedRename: 0