atteneder / KtxUnity

Load KTX and Basis Universal textures at runtime
Apache License 2.0
215 stars 42 forks source link

Importing KTX on Linux for Build Target iOS fails #59

Closed Blackclaws closed 2 years ago

Blackclaws commented 2 years ago

This might be something you simply haven't tested but when importing KTX files on Linux using the iOS build target the import will fail. The reason is this line:

https://github.com/atteneder/KtxUnity/blob/7747a48d5e994db800b4c60a0a8b95a5ae2ce39f/Runtime/Scripts/KtxNativeInstance.cs#L28

which evaluates to true even on Linux. Thus it tries to load the dll from __Internal which doesn't have it. One solution would be to change it to:

#if UNITY_EDITOR_OSX || UNITY_WEBGL || (UNITY_IOS && !UNITY_EDITOR)

Maybe the same && for UNITY_WEBGL as that target should have similar problems in Editor on non macOS platforms.

atteneder commented 2 years ago

@Blackclaws Awesome! Thanks for the hint plus fix.

Yes, I probably have to test and fix this for Linux/WebGL as well. Great find.