Logo
UI Elements

Notification

A compact animated popup

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

NameTypeDescription
iconSpriteIcon displayed on the left
titlestringTitle text
descriptionstringBody description text

Settings

NameTypeDescription
useUnscaledTimeboolUses unscaled time for animations
playOnEnableboolAutomatically opens when enabled
autoCloseboolCloses automatically after delay
autoCloseDelayfloatDelay before auto close

Animation

NameTypeDescription
animationTypeAnimationTypeNone, Fade, Scale, Slide
animationCurveAnimationCurveEasing function
durationfloatOpen or close animation duration
scaleFromfloatStarting scale for Scale mode
slideOffsetVector2Offset used by Slide mode

Sound Effects

NameTypeDescription
sfxSourceStylingSourceDetermines how SFX are resolved
stylerPresetStylerPresetPreset containing audio mappings
openSFXAudioMappingPlayed when opening
closeSFXAudioMappingPlayed when closing

References

NameTypeDescription
iconImageImageIcon renderer
titleTextTextMeshProUGUITitle label
descriptionTextTextMeshProUGUIDescription label
canvasGroupCanvasGroupControls fade and interaction

Public Methods

NameParametersDescription
Open()NoneShows the notification with animation
Close()NoneCloses the notification with animation
ForceClose()NoneHides immediately without animation
SetContent(icon, title, description)Sprite, string, stringApplies new content and refreshes UI
SetIconSpriteSets icon and refreshes
SetTitlestringSets title and refreshes
SetDescriptionstringSets description and refreshes
IsOpenboolIndicates if the notification is currently displayed

Code Example

NotificationExample.cs
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();
    }
}

On this page