Files
XCEngine/docs/api/scene/scene-manager/on-scene-unloaded.md

34 lines
602 B
Markdown
Raw Normal View History

# OnSceneUnloaded
Event triggered when a scene is unloaded.
## Syntax
```cpp
Core::Event<Scene*>& OnSceneUnloaded();
```
## Returns
Returns a reference to the `Core::Event<Scene*>` for this event.
## Remarks
Subscribe to this event to be notified when a scene is unloaded.
## See Also
- [OnSceneLoaded](on-scene-loaded)
- [OnActiveSceneChanged](on-active-scene-changed)
## Examples
```cpp
void Example() {
SceneManager& manager = SceneManager::Get();
manager.OnSceneUnloaded().AddCallback([](Scene* scene) {
XC_LOG_INFO("Scene unloaded: {}", scene->GetName());
});
}
```