This is going to sound convoluted and like there are a dozen better ways to do this, but lets just act like I have no other options here.
I am the author of the fictional package FooBar that includes a dll that is built from source by me, from a fictional baz (Baz Shkara) · GitHub repo.
Baz is open source and routinely updated and my package users want to update the DLL in the package without having to wait for me to build a new dll and push a new version of the package.
For some unavoidable reasons that they refuse to divulge, users will not accept the answer “copy from packagecache into your project then replace the dll” and flat out refuse to even consider touching packagecache.
If I can assume that the users who want to do this have the repo cloned locally and all the requirements to compile and build the dll, is there a way to allow to enable the dll to be replaced? Overwritten? Ignored and redirect Unity to the new one? Anything?
Current ideas that I’m not happy with:
- Static string var containing the name of the dll and have users rename their built dll to “Baz_updated.dll”, update the static var to “Baz_updated” and use that static var in all my dll import statements.
- I rename my version of the dll “baz_orig.dll” and on import I scan their project assets for other copies of “baz.dll” and if it isn’t found, I copy “baz_orig.dll” into their project/plugins folder and rename it to “baz.dll” then refresh the asset database to resolve the dll not found errors. Since the only lib named “baz.dll” isn’t in my package it should be freely updateable by users.
I’m hopeful that something less janky is possible, maybe some Assetdatabase shenanigans or something.
Ideas?