34 lines
622 B
Markdown
34 lines
622 B
Markdown
|
|
# OnActiveSceneChanged
|
||
|
|
|
||
|
|
Event triggered when the active scene changes.
|
||
|
|
|
||
|
|
## Syntax
|
||
|
|
|
||
|
|
```cpp
|
||
|
|
Core::Event<Scene*>& OnActiveSceneChanged();
|
||
|
|
```
|
||
|
|
|
||
|
|
## Returns
|
||
|
|
|
||
|
|
Returns a reference to the `Core::Event<Scene*>` for this event.
|
||
|
|
|
||
|
|
## Remarks
|
||
|
|
|
||
|
|
Subscribe to this event to be notified when the active scene changes.
|
||
|
|
|
||
|
|
## See Also
|
||
|
|
|
||
|
|
- [SetActiveScene](set-active-scene)
|
||
|
|
- [GetActiveScene](get-active-scene)
|
||
|
|
|
||
|
|
## Examples
|
||
|
|
|
||
|
|
```cpp
|
||
|
|
void Example() {
|
||
|
|
SceneManager& manager = SceneManager::Get();
|
||
|
|
manager.OnActiveSceneChanged().AddCallback([](Scene* scene) {
|
||
|
|
XC_LOG_INFO("Active scene changed: {}", scene->GetName());
|
||
|
|
});
|
||
|
|
}
|
||
|
|
```
|