public void Update(double timePassed) { // If there's no message, just return if (Messages.Count() == 0 && currentMessage == null) return; // Checks if there's a message being shown if (timeLeft > 0) { timeLeft -= timePassed; return; } else if (timeLeft < 0) { timeLeft = 0; } // Unreference the shown message currentMessage = null; // If there's no message left, return if (Messages.Count() == 0) return; // Sets the message that will be shown, the cooldown and removes from the queue currentMessage = Messages[0]; Messages.RemoveAt(0); timeLeft = cooldown; }
public void ShowMessage(QuickMessage message) { Messages.Add(message); }