mcpiroman / UnityNativeTool

Allows to unload native plugins in Unity3d editor
MIT License
184 stars 19 forks source link

UnityPluginLoad/Unload callbacks not firing, warning to compile StubLluiPlugin after installing from .unitypackage #33

Closed nicolashahn closed 3 years ago

nicolashahn commented 3 years ago

Hi, relatively new to Unity so please bear with me.

I followed the instructions for installation in the readme by using the .unitypackage downloaded from the latest release (8.0) and have set up my project as per the readme "Usage" section. When I enter play mode, I'm getting the message:

StubLluiPlugin not found. UnityPluginLoad and UnityPluginUnload callbacks won't fire. If you didn't install UnityNativeTool from .unitypackage or it didn't contain the compiled plugin, you'll need to compile it manually. You may also comment out this warning if you don't care about these callbacks.

I do need these callbacks for my project. I'm wondering why I'm seeing this warning given I installed from a .unitypackage, but more importantly, I'm not sure how I would compile it manually. Is there a specific command you can give?

mcpiroman commented 3 years ago

It seems I simply forgot to embed it in the latest unitypackege. Or maybe I didn't do that purposely, I can't remember. I will investigate that in some time and probably attach the required file.

To compile it manually, take the stubLluiPlugin.c file, compile it as a dynamic library with the same name (without .c ofc) and put along your other DLLs (but without __).

mcpiroman commented 3 years ago

I've updated the release (and readme) with the stub plugin, you may try that in case you don't have it yet.

nicolashahn commented 3 years ago

Thank you, it works!