public static void RealTimeUpdate() { while (actionQueue.Count > 0 && actionQueue.Peek().time <= time) { GameAction action = actionQueue.Dequeue(); if (!action.actually) { continue; } action.DoAction(); } }
private void Update() { if (IsCountingDown) { timeRemaining -= Time.deltaTime; if (timeRemaining <= 0) { timeRemaining = 0; IsCountingDown = false; if (GameAction) { GameAction.DoAction(); } } if (Display) { Display.text = "Time Remaining: \n" + System.Math.Floor(timeRemaining); } } }