Description
The HasUnsavedChanges
property of the HammerSceneEditorSession
class indicates whether there are any unsaved changes in the current editing session. This property is useful for determining if the user needs to be prompted to save changes before closing the session or performing other actions that might result in data loss.
Usage
To use the HasUnsavedChanges
property, simply access it from an instance of HammerSceneEditorSession
. It returns a bool
value: true
if there are unsaved changes, and false
otherwise.
Example
// Example of checking for unsaved changes in a HammerSceneEditorSession
HammerSceneEditorSession session = new HammerSceneEditorSession();
if (session.HasUnsavedChanges)
{
// Prompt the user to save changes
// SaveChanges();
// Or handle unsaved changes accordingly
}
else
{
// Proceed with closing the session or other operations
}