Unity Plugin classes Life cycle

Hello.

we're writing a plugin for the unity editor. this plugin has a pretty heavy initialization (10-20seconds). Unfortunately, it seems that our plugin classes gets 'reloaded' multiple times while unity is running (eg: when starting the game scene), invalidating all the previous initialization. Of course, all static variables are also cleaned up in the process (singletons).

is there a way to prevent this behavior somehow ?

thank you

Remy

The documentation has a section on script compilation that may be relevant. Note that if any of your editor scripts change then they will all be recompiled (and thus reinitialized). (I'm assuming you mean a plugin created as an editor script.)

Possibly you can put a precompiled .NET DLL into the Editor folder, I haven't tried this.