public void SetNotification(string message, NotificationLifeTimeType notificationLifeTime, NotificationType notificationType) { _textMessage.text = message; _imageNotificationColor.color = GetNotificationColor(notificationType); StopAllCoroutines(); StartCoroutine(HideNotification(GetNotificationLifeTime(notificationLifeTime))); }
private float GetNotificationLifeTime(NotificationLifeTimeType type) { switch (type) { case NotificationLifeTimeType.Long: return(_long); case NotificationLifeTimeType.Medium: return(_medium); case NotificationLifeTimeType.Short: return(_short); } Debug.LogError("Unknow notificationLifeTime!"); Debug.Break(); return(10); }