This commit is contained in:
SanderSwi 2022-01-30 14:48:32 +01:00
commit 28b67d79b8
3 changed files with 23 additions and 8 deletions

View File

@ -7625,7 +7625,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: -2.8084307}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &8087737910312270468

View File

@ -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}

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;