3. Saving and Loading a World
<< RETURN TO THE PREVIOUS SECTION
Some applications manage a single world, while other require several worlds to be managed. In any case, it is very useful to know how to save our current world and load some other. In order to solve this task, we should use the console via the Console class, which is designed as a singleton.
In order to use the Console class, include the UnigineConsole.h library.
#include <UnigineConsole.h>
using namespace Unigine;
/* .. */
// saving current world to the my_world.world file
Console::run("world_save my_world");
// loading world from the my_world.world file
Console::run("world_load my_world");
Additional information:
- For more information on the console and available commands, see Console page.
- For more information on managing the console via API, see Console class page.
Last update:
2019-12-25
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)