From a227d09d68187f80d620e2021be2c84979498710 Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Sat, 27 Apr 2019 20:27:35 +0200 Subject: Fixed messaging breaking spawning --- nGJ2019/Assets/Scripts/EventTimeline.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'nGJ2019/Assets/Scripts/EventTimeline.cs') 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); - } + } } } -- cgit v1.2.3