This page has been translated automatically.
Программирование
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

3. Saving and Loading a World

<< RETURN TO THE PREVIOUS SECTION

Some applications manage a single world, while others 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 taks we should use the console via the Console class, which is designed as a singleton.

Notice
In order to use the Console class we must include the UnigineConsole.h library.
Source code (C++)
#include <UnigineConsole.h>
/* .. */

// saving current world to the my_world.world file
Console::get()->run("world_save my_world");

// loading world from the my_world.world file
Console::get()->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.

PROCEED TO THE NEXT SECTION >>

Last update: 21.12.2017
Build: ()