Description
The ShowCloseDialog
method is a static method of the SceneEditorSession
class in the Editor
namespace. It is used to display a dialog that prompts the user to confirm the closure of the current scene. This method is particularly useful when there are unsaved changes in the scene, and the user needs to be notified before closing it.
Usage
To use the ShowCloseDialog
method, you need to pass a delegate of type System.Action
as a parameter. This delegate will be invoked when the dialog is closed, allowing you to define custom behavior upon closure.
Example
// Example usage of ShowCloseDialog
Editor.SceneEditorSession.ShowCloseDialog(() => {
// Code to execute when the dialog is closed
// For example, you might want to save changes or log the closure
SaveChanges();
});
void SaveChanges()
{
// Implement save logic here
}