Logo
UI Elements

Notification

Temporary messages with optional stacking and sound

Overview

Notification displays a short message with an optional icon and description. It supports automatic closing, stacking, sound effects, and Evo Tween animation sequences.

Preview

Usage

Create a Notification prefab and set its content.

Choose Auto Close and its delay.

Enable stacking when multiple notifications share a display area.

Call Open(), or use Notification.Create() to spawn a configured instance.


Public API

Use Notification in the Evo.UI namespace.

Pass openAfter: false to Create() when you need to configure a spawned notification before showing it.

Properties

NameTypeDescription
TitlestringDisplayed title.
DescriptionstringDisplayed description.
IconSpriteDisplayed sprite.
IsOpenboolRead-only open state.

Fields

NameTypeDescription
autoCloseboolCloses after the delay.
autoCloseDelayfloatSeconds before automatic closing.
showDurationBarboolShows the remaining auto close time on the duration bar.
durationBarProceduralShapeBar clipped by the remaining auto close time. Leave empty to skip it.
enableStackingboolCoordinates multiple notifications.
destroyAfterboolDestroys after closing.

Methods

NameParametersDescription
Open()NoneOpens the notification.
Close()NoneCloses with animation.
ForceClose()NoneCloses immediately.
SetContent()Sprite newIcon, string newTitle, string newDescriptionChanges icon, title, and description together.
Create()GameObject preset, Sprite icon, string title, string description, Transform parent, bool openAfter = trueInstantiates a notification under a parent and optionally opens it. Returns Notification.

Example

NotificationExample.cs
using UnityEngine;
using Evo.UI;

public class NotificationExample : MonoBehaviour
{
    [SerializeField] private Notification target;

    private void Start()
    {
        target.Title = "Saved";
        target.Description = "Your settings are up to date.";
        target.autoCloseDelay = 3f;
        target.Open();
    }
}

On this page