89 static void loadScene(
const std::string& nameOrPath,
91 bool discardPendingAsync =
true);
101 bool discardPendingAsync =
true);
114 static std::shared_ptr<AsyncOperation>
loadSceneAsync(
const std::string& nameOrPath,
116 bool discardPendingAsync =
true);
125 static std::shared_ptr<AsyncOperation>
loadSceneAsync(
int sceneId,
127 bool discardPendingAsync =
true);
137 static void unloadScene(
const std::string& nameOrPath);
#define ENGINE_API
Definition EngineAPI.hpp:10
LoadSceneMode
Determines whether loading a scene replaces or adds to the current set.
Definition SceneManagement.hpp:15
@ Additive
Load the new scene alongside existing ones.
Definition SceneManagement.hpp:17
@ Single
Unload all current scenes, then load the new one.
Definition SceneManagement.hpp:16
Static Unity-style API for scene loading, unloading, and event subscriptions.
Definition SceneManagement.hpp:76
static std::shared_ptr< AsyncOperation > loadSceneAsync(const std::string &nameOrPath, LoadSceneMode mode=LoadSceneMode::Single, bool discardPendingAsync=true)
Load a scene asynchronously by name or path.
Definition SceneManagement.cpp:69
static SceneInfo getSceneInfo(int sceneId)
Get scene info by integer ID.
Definition SceneManagement.cpp:136
static void unloadScene(const std::string &nameOrPath)
Unload a scene by its name or path.
Definition SceneManagement.cpp:103
static void onSceneUnloaded(std::function< void(const SceneInfo &)> callback)
Subscribe a callback to be fired whenever any scene is unloaded.
Definition SceneManagement.cpp:122
static void loadScene(const std::string &nameOrPath, LoadSceneMode mode=LoadSceneMode::Single, bool discardPendingAsync=true)
Load a scene by name or path.
Definition SceneManagement.cpp:41
static SceneManager * s_sceneManager
Definition SceneManagement.hpp:188
static std::vector< SceneInfo > getLoadedScenes()
Returns all currently loaded scenes.
Definition SceneManagement.cpp:131
static void onSceneLoaded(std::function< void(const SceneInfo &)> callback)
Subscribe a callback to be fired whenever any scene finishes loading.
Definition SceneManagement.cpp:117
static void setSceneManager(SceneManager *manager)
Called once at engine boot to wire the SceneManager.
Definition SceneManagement.cpp:21
Manages a set of simultaneously loaded Scenes. Supports Single and Additive loading,...
Definition SceneManager.hpp:54
Handle returned from loadSceneAsync(). Tracks async load progress.
Definition SceneManagement.hpp:35
std::atomic< float > progress
0.0 (start) to 1.0 (complete).
Definition SceneManagement.hpp:36
std::atomic< bool > isDone
True when the scene is fully loaded.
Definition SceneManagement.hpp:37
SceneInfo sceneInfo
Info about the scene being loaded.
Definition SceneManagement.hpp:38
std::function< void(const SceneInfo &)> onComplete
Optional per-operation callback fired when load completes.
Definition SceneManagement.hpp:41
Lightweight descriptor for a known or loaded scene.
Definition SceneManagement.hpp:24
bool isLoaded
True if the scene is currently active in the world.
Definition SceneManagement.hpp:28
std::string name
Scene base name (e.g. "level1").
Definition SceneManagement.hpp:26
std::string path
Full scene file path (e.g. "assets/scenes/level1.json").
Definition SceneManagement.hpp:27