logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class ToastFireNowGui

    Shared "Fire Now" preview logic for a toast: dispatches a ShowToastSignal through the live SerenityEditorSignalDispatcher, so both the standalone ToastPreviewWindow and the Theme Builder inspector can preview a toast in Play Mode without duplicating the gating/dispatch code.

    Inheritance
    object
    ToastFireNowGui
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Ui.Infrastructure.Editor.Components.Toast
    Assembly: Serenity.UnityUi.Infrastructure.Editor.dll
    Syntax
    public static class ToastFireNowGui
    Remarks

    Every public member is deliberately string/bool/void: Serenity.UnityUi.Installation.Editor (home of UnityUiThemeDefinitionEditor) reaches this class only transitively through Serenity.UnityUi.Infrastructure.Editor and does not reference the EventDispatcher editor assembly directly — exposing a signal or dispatcher type here would force that reference.

    Methods

    DrawSection(string, bool, string)

    Draws the shared preview section: a bold section label, a blocked-reason HelpBox when firing is not currently possible, and a disabled-when-blocked "Fire Now" button.

    Declaration
    public static void DrawSection(string message, bool translate, string sectionLabel = "Preview")
    Parameters
    Type Name Description
    string message

    The text the toast should display when fired.

    bool translate

    Whether message should be treated as a localization key.

    string sectionLabel

    Section heading drawn above the button.

    FireNow(string, bool)

    Dispatches a toast carrying message through the live dispatcher.

    Declaration
    public static bool FireNow(string message, bool translate)
    Parameters
    Type Name Description
    string message

    The text the toast should display.

    bool translate

    Whether message should be treated as a localization key.

    Returns
    Type Description
    bool

    true when the toast was dispatched.

    GetBlockedReason()

    Why the preview cannot run right now, or null when it can.

    Declaration
    public static string GetBlockedReason()
    Returns
    Type Description
    string
    In this article
    © 2026 Serenity. All Rights Reserved