Files
XCEngine/docs/api/scene/scene-manager/get-active-scene.md

30 lines
478 B
Markdown
Raw Normal View History

# GetActiveScene
Get the currently active scene.
## Syntax
```cpp
Scene* GetActiveScene() const;
```
## Returns
Returns a pointer to the currently active `Scene`, or `nullptr` if no scene is active.
## See Also
- [SetActiveScene](set-active-scene)
## Examples
```cpp
void Example() {
SceneManager& manager = SceneManager::Get();
Scene* active = manager.GetActiveScene();
if (active) {
XC_LOG_INFO("Active scene: {}", active->GetName());
}
}
```