diff options
author | marcinzelent <zelent.marcin@gmail.com> | 2019-04-27 21:29:56 +0200 |
---|---|---|
committer | marcinzelent <zelent.marcin@gmail.com> | 2019-04-27 21:29:56 +0200 |
commit | c6cc2672f7033d099630238b72549b42507e6ebd (patch) | |
tree | c93cdc0a9770c215456f3235c126eaea026a5671 /nGJ2019/Assets/Scripts/ObstacleSpawner.cs | |
parent | 529f858949fb2aef71692cc127c22a9a20008ada (diff) |
Changed SpawnEvent to use Vector3 position
Diffstat (limited to 'nGJ2019/Assets/Scripts/ObstacleSpawner.cs')
-rw-r--r-- | nGJ2019/Assets/Scripts/ObstacleSpawner.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/nGJ2019/Assets/Scripts/ObstacleSpawner.cs b/nGJ2019/Assets/Scripts/ObstacleSpawner.cs index 0e6b3ac..a23b8aa 100644 --- a/nGJ2019/Assets/Scripts/ObstacleSpawner.cs +++ b/nGJ2019/Assets/Scripts/ObstacleSpawner.cs @@ -34,7 +34,7 @@ public class ObstacleSpawner : MonoBehaviour break; } - var o = Instantiate(prefab, new Vector3(spawnLine, e.height, 0), Quaternion.identity); + var o = Instantiate(prefab, new Vector3(spawnLine, e.position.y, e.position.z), Quaternion.identity); scrolling.Obstacles.Add(o); } @@ -42,12 +42,12 @@ public class ObstacleSpawner : MonoBehaviour { for (int i = 0; i < 120; i += 5) { - timeline.Add(i, 0, ObstacleType.caveWalls); + timeline.Add(i, new Vector3(0, 0, 0), ObstacleType.caveWalls); } - timeline.Add(2, 2.75f, ObstacleType.rockTop); - timeline.Add(8, -2, ObstacleType.rockBottom); - timeline.Add(20, 0, ObstacleType.narrowPassage); - timeline.Add(30, 0, ObstacleType.rockJaws); + timeline.Add(2, new Vector3(0, 2.75f, 0), ObstacleType.rockTop); + timeline.Add(8, new Vector3(0, -2, 0), ObstacleType.rockBottom); + timeline.Add(20, new Vector3(0, 0, 0), ObstacleType.narrowPassage); + timeline.Add(30, new Vector3(0, 0, 1), ObstacleType.rockJaws); timeline.OnSpawnEvent += spawnOnEvent; } |