mcpiroman / UnityNativeTool

Allows to unload native plugins in Unity3d editor
MIT License
183 stars 18 forks source link

native rendering plugins #4

Closed JeffBail closed 5 years ago

JeffBail commented 5 years ago

I have a native rendering plugin that works fine in the Editor but when I try to load it via UnityNativeTool it reports a NativeDllException and the Game view seems to freeze up. Is it possible to unload & reload rendering plugins or are they just tied in too tightly?

mcpiroman commented 5 years ago

The low-level callback functions such as UnityPluginLoad are not supported (they simply don't fire). I should've mentioned this in the limitations though. I might figure out a a way to handle that in the future but this should be hard enough.

If you get NativeDllException, then the game should not freeze but simply pause (if you use recent version of this tool) allowing you to fix the problem. Secondly, this exception should only indicate that your DLL or function that you used in managed code was not found. So e.g. make sure that you add __ at the beginning of plugin file name.

mcpiroman commented 5 years ago

Good news. Apparently I did manage to get it to work with UnityPluginLoad (and UnityPluginUnload), which should be enough for most rendering plugins to work. Check out last release.

JeffBail commented 5 years ago

Thanks! This works great with Unity's NativeRenderingPlugin example with 2019.1.5f1.