/// <summary>Notifies the player with given message</summary> public void Notify(string message, NotificationStayTime speed, Sprite icon = null) { var queable = new QueableNotification { Message = message, StayTime = speed, Icon = icon }; if (!isNotifying) { StartNofication(queable); } else { notificationQueue.Enqueue(queable); } }
/// <summary>Starts the notification popup with given message</summary> private void StartNofication(QueableNotification notification) { if (notification.Icon != null) { imgNotification.sprite = notification.Icon; imgNotification.color = Color.white; } else { imgNotification.sprite = defaultIcon; imgNotification.color = defaultIconColor; } txtNotification.text = notification.Message; StartCoroutine(NotifyEnumerator((int)notification.StayTime)); }