예제 #1
0
    /// <summary>
    ///   Shows an error dialog
    /// </summary>
    /// <param name="title">Title of the dialog to show</param>
    /// <param name="message">Message to show</param>
    /// <param name="exception">Extra / exception info to show</param>
    /// <param name="returnToMenu">
    ///   If true closing the dialog returns to menu. If false the dialog is just closed (and game is unpaused)
    /// </param>
    /// <param name="onClosed">Callback for when the dialog is closed</param>
    public void ShowError(string title, string message, string exception, bool returnToMenu = false,
                          Action onClosed = null)
    {
        errorDialog.WindowTitle    = title;
        extraDescriptionLabel.Text = message;
        exceptionLabel.Text        = exception;
        errorDialog.PopupCenteredShrink();

        onDialogDismissReturnToMenu = returnToMenu;
        onDialogCloseCallback       = onClosed;
    }