Evo uiUi elements
Notification
A compact animated popup
This page documents Evo UI v1. For the current version, see Evo UI v2. Upgrading? Read the migration guide.
Overview
Notification displays a small popup message with a title, description, and optional icon. The component is ideal for toast messages, alerts, quick tips, or system notifications.
Notifications can open automatically on enable or be opened manually. Closing can happen automatically after a delay or be triggered through script.
You can create the object, call Open() to show the notification, and Close() to hide it.
Properties
Content
| Name | Type | Description |
|---|---|---|
icon | Sprite | Icon displayed on the left |
title | string | Title text |
description | string | Body description text |
Settings
| Name | Type | Description |
|---|---|---|
useUnscaledTime | bool | Uses unscaled time for animations |
playOnEnable | bool | Automatically opens when enabled |
autoClose | bool | Closes automatically after delay |
autoCloseDelay | float | Delay before auto close |
Animation
| Name | Type | Description |
|---|---|---|
animationType | AnimationType | None, Fade, Scale, Slide |
animationCurve | AnimationCurve | Easing function |
duration | float | Open or close animation duration |
scaleFrom | float | Starting scale for Scale mode |
slideOffset | Vector2 | Offset used by Slide mode |
Sound Effects
| Name | Type | Description |
|---|---|---|
sfxSource | StylingSource | Determines how SFX are resolved |
stylerPreset | StylerPreset | Preset containing audio mappings |
openSFX | AudioMapping | Played when opening |
closeSFX | AudioMapping | Played when closing |
References
| Name | Type | Description |
|---|---|---|
iconImage | Image | Icon renderer |
titleText | TextMeshProUGUI | Title label |
descriptionText | TextMeshProUGUI | Description label |
canvasGroup | CanvasGroup | Controls fade and interaction |
Public Methods
| Name | Parameters | Description |
|---|---|---|
Open() | None | Shows the notification with animation |
Close() | None | Closes the notification with animation |
ForceClose() | None | Hides immediately without animation |
SetContent(icon, title, description) | Sprite, string, string | Applies new content and refreshes UI |
Icon | Sprite | Sets icon and refreshes |
Title | string | Sets title and refreshes |
Description | string | Sets description and refreshes |
IsOpen | bool | Indicates if the notification is currently displayed |
Code Example
using UnityEngine;
using Evo.UI;
public class NotificationExample : MonoBehaviour
{
public Notification notif;
void Start()
{
// Change content
notif.SetContent(infoIcon, "Saved", "Your settings have been saved.");
// Open notification
notif.Open();
// Or close manually
notif.Close();
// Force close instantly
notif.ForceClose();
}
}