How to Split Up an Existing Unity Git Project into Smaller Unity Packages


Update 4/29/2020: indicated new dependencies added in Template Unity Package under Step 8 that should be left in the asmdef files.

After years of making a ton of Unity games, I’ve accumulated a lot of tools that are gathered into a single Template Unity Project that I start every game jam project in. That said, the project is now much larger than I would like. Some tools, such as the web host domain list, is only applicable for projects intended to be exported to the web. In addition, since everything is built on the same project solution, compiling new scripts takes longer than necessary. So I figured it was time to split up this mammoth project into smaller Unity packages. But how?

True to Unity’s theme of democratizing game development, they have extensive documentation on how to utilize the new Unity Package Manager to better import other tools and projects. Furthermore, mob-sakai has an excellent tutorial on how to setup a Git repository with the command, git subtree split, such that the Package Manager can easily import the project. But all these information are only great for creating a single Unity Package; what if, like me, you have a sprawling Unity project that you want to split up into multiple, smaller Unity Packages? After doing some research, I’ve came to the conclusion that the best method is to use Unity’s local package directory structure, and more importantly, git submodule add to nest another Git project to easily drag-and-drop project files into. This post will go into more details on how this works.

Continue reading “How to Split Up an Existing Unity Git Project into Smaller Unity Packages” 1 Comment on How to Split Up an Existing Unity Git Project into Smaller Unity Packages | Categories: Game Development, Tutorial