diff options
author | Mikkel Bybjerg <mikkel.bybjerg@hotmail.com> | 2019-04-28 03:45:41 +0200 |
---|---|---|
committer | Mikkel Bybjerg <mikkel.bybjerg@hotmail.com> | 2019-04-28 03:45:41 +0200 |
commit | f28fd7ed5916af2a5a590e36635859d2a4a7cc3c (patch) | |
tree | dca755531321f276e33e466a61ddd93cd43d77fb /nGJ2019/Assets/Scripts/ObstacleSpawner.cs | |
parent | dd492fa6f63bce29edc1945ad183704580a27112 (diff) | |
parent | eebe04b0c81dc2660335a1e09157c7a18189ddc3 (diff) |
merge
Diffstat (limited to 'nGJ2019/Assets/Scripts/ObstacleSpawner.cs')
-rw-r--r-- | nGJ2019/Assets/Scripts/ObstacleSpawner.cs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/nGJ2019/Assets/Scripts/ObstacleSpawner.cs b/nGJ2019/Assets/Scripts/ObstacleSpawner.cs index 4c4028f..3c09e6f 100644 --- a/nGJ2019/Assets/Scripts/ObstacleSpawner.cs +++ b/nGJ2019/Assets/Scripts/ObstacleSpawner.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System.Collections; using System.Collections.Generic; using UnityEngine; @@ -43,15 +43,19 @@ public class ObstacleSpawner : MonoBehaviour void Start() { - for (int i = 0; i < 120; i += 5) + var scene = UnityEngine.SceneManagement.SceneManager.GetActiveScene(); + if (scene.name == "TitleScreen") { - timeline.Add(i, new Vector3(0, 0, 0), ObstacleType.caveWalls); + for (int i = 0; i < 1000; i++) + { + timeline.Add(i * 2.5f, new Vector3(0, 0, 0), ObstacleType.caveWalls); + timeline.Add(i * 12.5f + 3, new Vector3(0, 2.75f, 0), ObstacleType.rockTop); + timeline.Add(i * 12.5f + 6, new Vector3(0, -2, 0), ObstacleType.rockBottom); + timeline.Add(i * 12.5f + 9, new Vector3(0, 0, 0), ObstacleType.narrowPassage); + timeline.Add(i * 12.5f + 12.5f, new Vector3(0, -2.5f, 2), ObstacleType.rockJaws); + timeline.Add(i * 12.5f + 15f, new Vector3(0, 0.5f, 3), ObstacleType.net); + } } - timeline.Add(0, new Vector3(0, 2.75f, 0), ObstacleType.rockTop); - timeline.Add(6, new Vector3(0, -2, 0), ObstacleType.rockBottom); - timeline.Add(12, new Vector3(0, 0, 0), ObstacleType.narrowPassage); - timeline.Add(20, new Vector3(0, -2.5f, 2), ObstacleType.rockJaws); - timeline.Add(25, new Vector3(0, 0.5f, 3), ObstacleType.net); timeline.OnSpawnEvent += spawnOnEvent; } |