From 629ebe5bd0fadef26196f7008666dc242b760603 Mon Sep 17 00:00:00 2001 From: GamerClassN7 Date: Sun, 30 Jan 2022 14:46:59 +0100 Subject: [PATCH] Fixe --- Assets/Scenes/Vasek.unity | 5 ----- Assets/Scripts/ProceduralGeneration.cs | 28 ++++++++++++++++++++------ 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/Assets/Scenes/Vasek.unity b/Assets/Scenes/Vasek.unity index e89c7c4..6adc5cd 100644 --- a/Assets/Scenes/Vasek.unity +++ b/Assets/Scenes/Vasek.unity @@ -5115,7 +5115,6 @@ MonoBehaviour: - {fileID: 8768991388683709947, guid: 2e18815c9b04872428df50ccfc059d03, type: 3} - {fileID: 8768991388683709947, guid: 99c4e582c7358f346ab00dae4ae956f9, type: 3} - {fileID: 7308296215773848360, guid: 9d0c33f32140d6b4da45d7ecaa694f1b, type: 3} - - {fileID: 1560962678462888388, guid: 8f7d93327dfedaf419b7f63ddb78c6bb, type: 3} - {fileID: 7678802340880963262, guid: c7b1510ab2ab8e349bfaafa501cecb1f, type: 3} - {fileID: 8768991388683709947, guid: 32d2ba4971e4c7e4ab98a1f9c37dcffc, type: 3} - {fileID: 6650340373999088090, guid: 76b3e3235b07ca04f91c9b020603e1dd, type: 3} @@ -5322,10 +5321,6 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 8683524639276378526, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3} - propertyPath: m_AnchoredPosition.y - value: -2.8084307 - objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3} --- !u!1 &1553744186 diff --git a/Assets/Scripts/ProceduralGeneration.cs b/Assets/Scripts/ProceduralGeneration.cs index e0be2da..ad46c96 100644 --- a/Assets/Scripts/ProceduralGeneration.cs +++ b/Assets/Scripts/ProceduralGeneration.cs @@ -179,7 +179,14 @@ public class ProceduralGeneration : MonoBehaviour { if (this.spawnedLevelBlocks.Count < 3) { - blockToSpawn = 10; + blockToSpawn = 9; + } + else + { + if (lastBlockPrefab.name == "platform_rrange" && levelBlocks[blockToSpawn].name != "platform_empty") + { + blockToSpawn = 3; + } } blockObjToSpawn = levelBlocks[blockToSpawn]; @@ -188,13 +195,22 @@ public class ProceduralGeneration : MonoBehaviour } else { - List instantiatedGameObjectLists = this.spawnSpiralOfPlatforms(lastBlock, levelBlocks[0], this.levelParrent); - foreach (var spavnedBlock in instantiatedGameObjectLists) + if (lastBlockPrefab.name == "platform_rrange") { - this.spawnedLevelBlocks.Add(spavnedBlock); + blockObjToSpawn = levelBlocks[3]; + instantiatedGameObject = this.drawPlatform(this.lastBlock, this.levelBlocks[3], this.levelParrent); + this.spawnedLevelBlocks.Add(instantiatedGameObject); + } + else + { + List instantiatedGameObjectLists = this.spawnSpiralOfPlatforms(lastBlock, levelBlocks[0], this.levelParrent); + foreach (var spavnedBlock in instantiatedGameObjectLists) + { + this.spawnedLevelBlocks.Add(spavnedBlock); + } + instantiatedGameObject = this.spawnedLevelBlocks[this.spawnedLevelBlocks.Count - 1]; + blockObjToSpawn = levelBlocks[0]; } - instantiatedGameObject = this.spawnedLevelBlocks[this.spawnedLevelBlocks.Count - 1]; - blockObjToSpawn = levelBlocks[0]; } this.lastBlock = instantiatedGameObject;