IEnumerator PlayAndHideNotification(NRNotification notification) { float fadeDuration = (float)NRSettings.config.UIFadeDuration; //TODO: Set icon to success or fail or info switch (notification.type) { case NRNotifType.Success: break; } //Reset the notif; text.SetText(notification.content); sliderImg.color = EditorInput.GetSelectedColor(); slider.sizeDelta = new Vector2(0, 0); //FADE IN nImage.DOFade(notifOpacity, fadeDuration / 2f); successIcon.DOFade(1f, fadeDuration / 2f); text.DOFade(1f, fadeDuration / 2f); sliderImg.DOFade(1f, fadeDuration / 2f); //Start the slider going DOTween.To(SetSliderWidth, 0f, 183.13f, notification.duration).SetEase(Ease.InOutCubic); yield return(new WaitForSeconds(notification.duration)); //FADE OUT nImage.DOFade(0, fadeDuration / 2f); successIcon.DOFade(0, fadeDuration / 2f); text.DOFade(0, fadeDuration / 2f); sliderImg.DOFade(0, fadeDuration / 2f); yield break; }
public static void AddNotifToQueue(NRNotification notif) { notifications.Add(notif); }