diff --git a/Assets/Prefabs/Platforms/chunk_loop Variant.prefab b/Assets/Prefabs/Platforms/chunk_loop Variant.prefab new file mode 100644 index 0000000..9d3696e --- /dev/null +++ b/Assets/Prefabs/Platforms/chunk_loop Variant.prefab @@ -0,0 +1,179 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1001 &5655692384574475916 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 227903404414380179, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_Name + value: chunk_loop + objectReference: {fileID: 0} + - target: {fileID: 717028255710887108, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 0} + - target: {fileID: 1581099807273813101, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: color.a + value: 0.8663576 + objectReference: {fileID: 0} + - target: {fileID: 1581099807273813101, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: emissionUp + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2319157629489888751, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: color.a + value: 0.8663576 + objectReference: {fileID: 0} + - target: {fileID: 2319157629489888751, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: emissionUp + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3438793468450317897, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: color.a + value: 0.8663576 + objectReference: {fileID: 0} + - target: {fileID: 3438793468450317897, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: emissionUp + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3441825231734693490, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3441825231734693490, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3441825231734693490, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3441825231734693490, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3441825231734693490, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3441825231734693490, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3441825231734693490, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3441825231734693490, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3441825231734693490, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3441825231734693490, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3441825231734693490, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4046279780535153479, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: color.a + value: 0.8663576 + objectReference: {fileID: 0} + - target: {fileID: 4046279780535153479, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: emissionUp + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5191330650780006077, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 0} + - target: {fileID: 5246183545790649614, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: color.a + value: 0.8663576 + objectReference: {fileID: 0} + - target: {fileID: 5246183545790649614, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: emissionUp + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5560813059931370072, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 0} + - target: {fileID: 5583649251154797518, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: color.a + value: 0.8663576 + objectReference: {fileID: 0} + - target: {fileID: 5583649251154797518, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: emissionUp + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6276350747539873226, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 0} + - target: {fileID: 6933565818185019858, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 0} + - target: {fileID: 7025949950676294748, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 0} + - target: {fileID: 7184203947689591411, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 0} + - target: {fileID: 7901524657762734192, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: color.a + value: 0.8663576 + objectReference: {fileID: 0} + - target: {fileID: 7901524657762734192, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: emissionUp + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8557637333134395230, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: color.a + value: 0.8663576 + objectReference: {fileID: 0} + - target: {fileID: 8557637333134395230, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: emissionUp + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8792983175967883553, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 0} + - target: {fileID: 8861260383688057481, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: color.a + value: 0.8663576 + objectReference: {fileID: 0} + - target: {fileID: 8861260383688057481, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: emissionUp + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9032494463022098444, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 0} + - target: {fileID: 9039345283432774328, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: color.a + value: 0.8663576 + objectReference: {fileID: 0} + - target: {fileID: 9039345283432774328, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: emissionUp + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9177498565491931535, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: fe24996af0c9aa44cb6ea0408cbfb1c5, type: 3} diff --git a/Assets/Prefabs/Platforms/chunk_loop Variant.prefab.meta b/Assets/Prefabs/Platforms/chunk_loop Variant.prefab.meta new file mode 100644 index 0000000..11975c1 --- /dev/null +++ b/Assets/Prefabs/Platforms/chunk_loop Variant.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0b012cacc00335a42b77f11e349d334e +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/ProceduralGeneration.cs b/Assets/Scripts/ProceduralGeneration.cs index 78cac6c..682c188 100644 --- a/Assets/Scripts/ProceduralGeneration.cs +++ b/Assets/Scripts/ProceduralGeneration.cs @@ -58,6 +58,7 @@ public class ProceduralGeneration : MonoBehaviour } GameObject drawPlatform(GameObject lastObject, GameObject objToSpawn, GameObject parentLevelObject) { + Bounds bounds = this.getPrefabBounds(lastObject); Bounds b = this.getPrefabBounds(objToSpawn); Vector3 nextBlockLocation = new Vector3(lastObject.transform.position.x, lastObject.transform.position.y, lastObject.transform.position.z + bounds.extents.z + b.extents.z); @@ -177,6 +178,11 @@ public class ProceduralGeneration : MonoBehaviour if (blockToSpawn > -1 && (blockToSpawn < levelBlocks.Count)) { + if (this.spawnedLevelBlocks.Count == 3) + { + blockToSpawn = 10; + } + blockObjToSpawn = levelBlocks[blockToSpawn]; instantiatedGameObject = this.drawPlatform(this.lastBlock, this.levelBlocks[blockToSpawn], this.levelParrent); this.spawnedLevelBlocks.Add(instantiatedGameObject);