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

@ -5115,7 +5115,6 @@ MonoBehaviour:
- {fileID: 8768991388683709947, guid: 2e18815c9b04872428df50ccfc059d03, type: 3} - {fileID: 8768991388683709947, guid: 2e18815c9b04872428df50ccfc059d03, type: 3}
- {fileID: 8768991388683709947, guid: 99c4e582c7358f346ab00dae4ae956f9, type: 3} - {fileID: 8768991388683709947, guid: 99c4e582c7358f346ab00dae4ae956f9, type: 3}
- {fileID: 7308296215773848360, guid: 9d0c33f32140d6b4da45d7ecaa694f1b, type: 3} - {fileID: 7308296215773848360, guid: 9d0c33f32140d6b4da45d7ecaa694f1b, type: 3}
- {fileID: 1560962678462888388, guid: 8f7d93327dfedaf419b7f63ddb78c6bb, type: 3}
- {fileID: 7678802340880963262, guid: c7b1510ab2ab8e349bfaafa501cecb1f, type: 3} - {fileID: 7678802340880963262, guid: c7b1510ab2ab8e349bfaafa501cecb1f, type: 3}
- {fileID: 8768991388683709947, guid: 32d2ba4971e4c7e4ab98a1f9c37dcffc, type: 3} - {fileID: 8768991388683709947, guid: 32d2ba4971e4c7e4ab98a1f9c37dcffc, type: 3}
- {fileID: 6650340373999088090, guid: 76b3e3235b07ca04f91c9b020603e1dd, type: 3} - {fileID: 6650340373999088090, guid: 76b3e3235b07ca04f91c9b020603e1dd, type: 3}
@ -5322,10 +5321,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8683524639276378526, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
propertyPath: m_AnchoredPosition.y
value: -2.8084307
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3} m_SourcePrefab: {fileID: 100100000, guid: ec622cf6f0988bc42a99ba84304c15a9, type: 3}
--- !u!1 &1553744186 --- !u!1 &1553744186

View File

@ -179,7 +179,14 @@ public class ProceduralGeneration : MonoBehaviour
{ {
if (this.spawnedLevelBlocks.Count < 3) 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]; blockObjToSpawn = levelBlocks[blockToSpawn];
@ -187,6 +194,14 @@ public class ProceduralGeneration : MonoBehaviour
this.spawnedLevelBlocks.Add(instantiatedGameObject); this.spawnedLevelBlocks.Add(instantiatedGameObject);
} }
else else
{
if (lastBlockPrefab.name == "platform_rrange")
{
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); List<GameObject> instantiatedGameObjectLists = this.spawnSpiralOfPlatforms(lastBlock, levelBlocks[0], this.levelParrent);
foreach (var spavnedBlock in instantiatedGameObjectLists) foreach (var spavnedBlock in instantiatedGameObjectLists)
@ -196,6 +211,7 @@ public class ProceduralGeneration : MonoBehaviour
instantiatedGameObject = this.spawnedLevelBlocks[this.spawnedLevelBlocks.Count - 1]; instantiatedGameObject = this.spawnedLevelBlocks[this.spawnedLevelBlocks.Count - 1];
blockObjToSpawn = levelBlocks[0]; blockObjToSpawn = levelBlocks[0];
} }
}
this.lastBlock = instantiatedGameObject; this.lastBlock = instantiatedGameObject;
this.lastBlockPrefab = blockObjToSpawn; this.lastBlockPrefab = blockObjToSpawn;