Closed rogerbarton closed 4 years ago
Another question is whether this should always run in edit mode, and I think it shouldn't. There is always some overhead, in big code bases this might even briefly freeze editor. So I'd add an option to enable it (disabled by default), something like enableInEditMode
.
We can use OnEnable
or playModeStateChanged
when we enter play mode to setup, based on enableInEditMode
.
Is there still something left todo in this PR? I've been using this and it works for me.
Thanks!
Thanks for reviewing!
Works when native functions are called in edit mode. This can be useful when writing native dlls for the editor, e.g. custom model importer. The unloading is currently done in OnDisable, which may not be ideal.