bool HasUnsavedChanges { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The HasUnsavedChanges property is a boolean flag used by the editor to indicate whether an asset has modifications that have not yet been saved to disk. This property is useful for tracking changes and prompting users to save their work before closing or performing other actions that might result in data loss.

Usage

Use the HasUnsavedChanges property to check if an asset has unsaved changes. This can be particularly useful in scenarios where you need to ensure that all changes are saved before proceeding with operations like closing the editor or switching projects.

Example

// Example of checking if an asset has unsaved changes
Editor.Asset asset = GetAsset();
if (asset.HasUnsavedChanges)
{
    // Prompt the user to save changes
    ShowSavePrompt(asset);
}