netpyoung / unity.webp

:art: WebP made easy for Unity3d
https://netpyoung.github.io/unity.webp/
MIT License
237 stars 28 forks source link

Externalize Unsafe dll for compatibility with other packages that depend on it #46

Closed roger-o3h closed 2 years ago

roger-o3h commented 2 years ago

Importing this package via UPM is not an option if you have another package that also wants to use System.Runtime.CompilerServices.Unsafe.dll, which is not unlikely.

Proposal is to depend on a third-party provider of this DLL, but its main weakness is that it depends on other package authors agreeing to this same method. My thought is that at least it extends the offer this way.

May still want to bundle the .unitypackage with the DLL so as to be plug-and-play, there may be some additional work needed to any scripts that generate the .unitypackage.

I wasn't able to get this sub-dependency method to work until I realized the sub-dependency's namespace must also be included in any scoped registry in the user's project, then UPM can resolve it.

Feel free to reject this or modify. Just something I ran into using your package and would like to see.

Thank you for creating and maintaining this package!

netpyoung commented 2 years ago

I didn't notice that https://github.com/system-community/SystemRuntimeCompilerServicesUnsafe is exist. Yes, your MR make help to make people who want use Unsafe.dll.

Thank you!