aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nGJ2019/Assets/Scripts/EventTimeline.cs7
-rw-r--r--nGJ2019/Assets/Scripts/Messenger.cs1
-rw-r--r--nGJ2019/Assets/Scripts/ObstacleSpawner.cs5
3 files changed, 8 insertions, 5 deletions
diff --git a/nGJ2019/Assets/Scripts/EventTimeline.cs b/nGJ2019/Assets/Scripts/EventTimeline.cs
index b864ae7..18b87cc 100644
--- a/nGJ2019/Assets/Scripts/EventTimeline.cs
+++ b/nGJ2019/Assets/Scripts/EventTimeline.cs
@@ -60,17 +60,20 @@ public class EventTimeline
{
currentTime += deltaTime;
- while(futureEvents.Count > 0 && currentTime > futureEvents[0].time && futureMessages.Count > 0 && currentTime > futureMessages[0].time)
+ while(futureEvents.Count > 0 && currentTime > futureEvents[0].time)
{
SpawnEvent e = futureEvents[0];
futureEvents.RemoveAt(0);
if(OnSpawnEvent != null)
OnSpawnEvent(e);
+ }
+ while(futureMessages.Count > 0 && currentTime > futureMessages[0].time)
+ {
MessageEvent m = futureMessages[0];
futureMessages.RemoveAt(0);
if(OnMessageEvent != null)
OnMessageEvent(m);
- }
+ }
}
}
diff --git a/nGJ2019/Assets/Scripts/Messenger.cs b/nGJ2019/Assets/Scripts/Messenger.cs
index ca2ffe1..21d2f8d 100644
--- a/nGJ2019/Assets/Scripts/Messenger.cs
+++ b/nGJ2019/Assets/Scripts/Messenger.cs
@@ -16,6 +16,7 @@ public class Messenger : MonoBehaviour
timeline = Spawner.GetEventTimeline();
timeline.Add(1, "Test");
+ timeline.Add(3, "");
timeline.OnMessageEvent += MessageOnEvent;
}
diff --git a/nGJ2019/Assets/Scripts/ObstacleSpawner.cs b/nGJ2019/Assets/Scripts/ObstacleSpawner.cs
index f438e85..0e6b3ac 100644
--- a/nGJ2019/Assets/Scripts/ObstacleSpawner.cs
+++ b/nGJ2019/Assets/Scripts/ObstacleSpawner.cs
@@ -8,7 +8,6 @@ public class ObstacleSpawner : MonoBehaviour
public GameObject caveWallsPrefab, rockTopPrefab, rockBottomPrefab, narrowPassagePrefab, rockJawsPrefab;
public LevelScrolling scrolling;
- public Messenger messenger;
public float spawnLine;
@@ -35,8 +34,8 @@ public class ObstacleSpawner : MonoBehaviour
break;
}
- var transformT = ((GameObject)Instantiate(prefab, new Vector3(spawnLine, e.height, 0), Quaternion.identity)).transform;
- scrolling.Obstacles.Add(transformT);
+ var o = Instantiate(prefab, new Vector3(spawnLine, e.height, 0), Quaternion.identity);
+ scrolling.Obstacles.Add(o);
}
void Start()