Jump to content

[SOLVED] editor plugins and world_reload


photo

Recommended Posts

Hi Danni, just a quick idea

 

/******************************************************************************\
*
* Plugin
*
\******************************************************************************/

string  plugin_world_name = "no_world";

/* this function should return plugin namespace name
*/
string getName() { return "Your plugin name"; }
/* plugin init
*/

void init() {
}

/* plugin shutdown
*/
void shutdown() {
}

/* plugin update, need_reload flag indicates that the editor resources should be updated
*/
void update(int need_reload) {

string world_name = engine.world.getName();

if( world_name != plugin_world_name )
{
   	// initial of new world loaded
   	.....
   	// actions on world_load
}

plugin_world_name = world_name;
...

}

Link to comment
×
×
  • Create New...