-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefix Almost Everything #39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems like it would break current interop assembly usage. It would require everyone to update their code to use the new prefix.
Some games have 100s of assemblies and are constantly growing. If someone wanted to preserve functionality of old code without having to recompile against the new prefix, every assembly will need to be specified and new assemblies will require updates to the mod loader package.
Could we possibly add an opt-in feature for prefixing (or not prefixing) any assemblies but the old ones we had specified?
I agree that this will break any code that relies on the current API, but on the other hand, I think that in the long run, this is the correct thing to do. How about introducing this behaviour as an opt-in for 1.x versions? Specifically
This way, we can at least provide a warning about this while still retaining the current behaviour until the next major release. Mod loaders can then choose what behaviour to use (in the case of BepInEx, we can enable exclusion behaviour right away for our doorstop 4 branch, but inclusion behaviour will be needed for current GTFO mods until they migrate too). Another option is that I can make a separate How about these two options -- which one would be better? Any other opinions on how to integrate this into master or address this being a breaking change are welcome. |
c661b91
to
8e1a597
Compare
I implemented your requested changes. A couple things of note:
|
I just added code to prevent |
Game developers often use the global namespace and external libraries when making their games. For modding, this can cause conflicts during mod development. Although we currently have a way to prefix assemblies and namespaces, it's an opt-in system. An opt-out solution would be better because mod loaders can't anticipate all the assemblies game communities might want to prefix. By prefixing everything but UnityEditor and UnityEngine, we can prevent all potential conflicts between generated interop and managed libraries.