mcpiroman / UnityNativeTool

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

Installing linux build support breaks windows dll loading #32

Closed emelrad12 closed 3 years ago

emelrad12 commented 3 years ago

In dll manipulator line 694, it check if it is UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX and for some reason that is true, but also UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN is true the solution is to move windows to the first if.

#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN 
            return PInvokes_Windows.FreeLibrary(libHandle);
#elif UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX
            return PInvokes_Osx.dlclose(libHandle) == 0;
#elif UNITY_STANDALONE_LINUX || UNITY_EDITOR_LINUX
            return PInvokes_Linux.dlclose(libHandle) == 0;
#else
            throw GetUnsupportedPlatformExcpetion();
#endif
mcpiroman commented 3 years ago

No idea why it's like that, but I'll merge your fix. Out of curiosity, what's your actual OS?

emelrad12 commented 3 years ago

I am on windows. Unity 2020.1.17f

And that is not a fix, but a workaround.