- Home /
How to share assets between projects with Unity Collaborate
Too Long; Didn't Read: Does someone know a good way to share assets between multiple projects using Unity Collaborate, when projects and shared assets are in development at the same time?
I am trying to migrate our projects' version control from Git and BitBucket to Unity Collaborate. We have a lot of assets that we want to share between projects. And those assets are under continuous development. Is there a way that I can accomplish the following:
When working on a project, shared assets should be placed in a subfolder of Assets and be easy to modify.
I can work on shared assets in any project to see how my changes affect that project before committing. I can also switch to another project to see how my changes affect that project.
I can run unit tests on shared code directly in unity.
When committing a change to a shared asset it is pushed to all projects.
A project close to release may choose to not pull changes to shared assets, while still pushing and pulling other changes normally.
Projects are integrated with Unity Cloud Build.
I have investigated the following approaches: (I haven't actually tried them all. Messing around with version control can cause hard-to-repair damage.)
Shared assets form a separate project which is exported and imported into each project. This is very cumbersome and requires a lot of manual export/import. It is also difficult to work on an asset without the context of a project. Fails most of the above requirements.
Everything is on the same repository. Projects are branched from the master, which contains all shared assets. This is what we have been doing so far. The result is frequent switching back and forth, conflicts, merge errors, commits that end up on a wrong branch and general confusion. AFAIK Collaborate does not support branches anyway.
Project assets are version controlled with collaborate, with shared assets on .collabignore. Shared assets are under external version control. Fails requirement number 6 - how can Unity Cloud Build build the project if half of it is on a different repository?
Each project has all assets under version control. Shared assets are duplicated across projects and ALSO under external version control. But having the same file under double version control seems kind of dodgy - will this go terribly wrong in ways I cannot predict?
Shared assets are a separate project in Collaborate version control. Each actual project on local machines contains a symbolic link to the Assets folder of the shared project. So each project and cloud build act as if the assets are a part of their project, unable to see that they are ALSO under Collaborate version control in the Shared project.
All of these approaches seem suboptimal or hacky to me. Does someone know of a better way?
Answer by HenrikLSP_IL · Sep 11, 2017 at 07:20 AM
I have decided to go with the double version control approach. Have each project in Unity Collaborate including shared assets and have the shared assets also under Git version control. This works fine so far, so long as we remember to pull and push to both systems. If unexpected problems come up later, I will edit this answer.
does it work still? did you have any major issue with this?
This approach has worked reasonably well for a couple of months. Remembering to pull and push to both systems is a bit of a hassle, but the consequences of forgetting are small. But we are only two developers working on two projects. I cannot tell if problems will arise if many people work on multiple projects at the same time.
Your answer
Follow this Question
Related Questions
Collaborate wants to push changes on many files I didn't edit 0 Answers
Unity Projects assets usable ? 0 Answers
All assets suddenly missing? 2 Answers
Lines of code are missing after using Unity Collaborate? 1 Answer
Why does Collaborate seem to be checking for changes on a folder it's supposed to be ignoring? 1 Answer