Jump to content

[SOLVED] saving world just before disposing unigine


photo

Recommended Posts

Technically not a c++ question but I thought it would be best suited here.

 

I have unigine running in a winform and I have a button that can exec a function to run engine.console.run("world_save");. This works fine while I keep Unigine running. But I also want to add the save feature to the OnFormClosing event so that I can save the world just before disposing of the engine. Problem is that a call to this console function won't actually save the world if I instantaneously do these things. Is there a way to say when this save is complete so I can delay the shutdown of the engine?

 

Thanks

Link to comment

All console command are executed at the beginning of the engine update function at once. You can save the world and shutdown engine via "world_save && quit" console command.

Link to comment

Thanks, got it working by canceling the close if chosen to save and flagging Unigine to callback to my app via script after it next hits the update loop, so I can then close having saved.

Link to comment
×
×
  • Create New...