-
Notifications
You must be signed in to change notification settings - Fork 110
Description
Describe the bug
Maybe I'm holding this wrong - in general it would be nice to have the zXing DLL already included in the sample project.
But anyway: I loaded zXing v0.16.11.0 and imported the according dlls located in unity into the Assets/Plugins folder.
Note that the name by default is zxing.unity.dll while your editor script ZXingDefineSymbolChecker for enabling the according ZXING_ENABLED is looking for *ZXing.dll / *zxing.dll and therefor doesn't find it => it deactivates the ZXING_ENABLED define.
My suggestion here would be that instead of the file name you rather check for the actual type like e.g.
const string typeName = "ZXing.QrCode.QRCodeReader";
foreach (var asm in AppDomain.CurrentDomain.GetAssemblies())
{
if (asm.GetType(typeName, throwOnError: false) != null)
return true;
}
return false;
Expected behavior
Make it easy for devs:
- Either already simply include a version of zXing (probably best the one you have been testing)
- Or at least make any dropped in zXing DLL work without depending on the exact file name
Besides that note that also in QrCodeDisplayManager not all things are properly wrapped in the ZXING_ENABLED pre-processor - the private methods at the bottom have compile errors if zXing is not present