I have two projects that I made separately. One is Blackjack and the other is simple poker. I am trying to connect the two via a main menu. When I try to import one project into the other a whole host of errors appear or script conflicts. How would you connect two separate projects into one with a main menu that essentially “calls” one game or the other?
Personally I would use a third ‘master’ project that the other two projects get imported into. I’d probably do this as a custom Unity Package Manager package: Unity - Manual: Creating custom packages
You would need to resolve the errors that are created when importing them into another project, including script conflicts. Any code that is shared between both projects can become another UPM package that all three projects are dependant on.
Given that UPM packages are immutable, care might need to be taken to ensure assets aren’t modifying themselves (such as scriptable objects).
There’s probably other ways with Addressables/Asset Bundles, this is just how I’d do it personally.
within each project, reorganize stuff so it has a common shared part and a custom-to-the-game part
put 100% of all scripts in the custom-to-the-game into their own namespace
do it with both poker and blackjack until you can get both of them dragged into a new third project
If you have shared common libraries, unify them to only have one shared version. If they are too divergent, keep both and put them each in namespaces.
Organize the games so you just have to load a scene called PokerStart or BlackjackNewgame or something, and every other part of logic flow is within each game.
Do all of this with constant checkins with source control. I’ve done it so many times to “gather up” my smaller games and even just simple game sub-modes put them out as one.
So go do some Operation Chimera… and don’t even think about doing it without proper source control.
DO NOT MOVE ANY script outside of Unity or you will break your prefabs. Make sure 100% of meta files remain with their files at all times: move stuff only within Unity.