This commit is contained in:
GamerClassN7
2022-01-30 14:46:59 +01:00
parent a29af42252
commit 629ebe5bd0
2 changed files with 22 additions and 11 deletions

View File

@@ -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<GameObject> 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<GameObject> 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;