I would like to use prefab assets to store a bunch of project-wide settings, similar in concept to a GUISkin. Will the .prefab files play nicely with version control?
More specifically, are my .prefab files fully self-contained, with no dependencies on the contents of the Library folder?
Feb 7, 2011 -- Thanks to tertle and DaveA for your thoughts on this. I'm going to carry on with putting prefabs into version control and see how it goes. So far so good.
Note that I up-voted both answers, but didn't actually mark either as correct, since there's still no definitive answer beyond what I originally suspected. (tertle's answer was auto-accepted by the bounty engine.)
More details ...
I don't need to be able to merge file revisions, but what I'm worried about is that a prefab may have hidden dependencies on the contents of the scene database -- all that opaque stuff in the Library\cache and Library\metadata folders.
On our project, we have two git repositories -- one for the Assets folder (art and code) and one for the Unity scene database (Library folder and friends). The Assets repository is used normally -- we all check stuff in and out throughout the day. The scene repository is "special" -- one person at a time owns it, and must get latest before making changes (which is a pain, but lets us carry on with Unity Free a while longer).
We currently have a GUISkin asset that sits in the Assets repository. This seems to be working fine. Looking at the .guiskin file and a .prefab file with a hex editor, it appears they use the same serialization mechanics, so I'm hoping that they would also both work fine in our git repository.
Being able to use prefabs more extensively would be useful, as it would let us move more design activities out of the scene repository and into the Assets repository.
I did search Answers for relevant info, and found some concerns with version control and prefabs in particular cases, but no general description of the issues. Info and advice appreciated.
codinghero posted a method of using SVN on free here: http://forum.unity3d.com/threads/43876-can-I-use-subversion-to-manage-my-unity-files?p=279261&viewfull=1#post279261 The whole thread is a good read though.
That all said I don't think you'll have issues other than really long rebuild times to update metadata from assets.
We have taken to exporting packages (along with the source), and putting them in SVN. Then import the package as needed. In theory that would wrap up any dependencies that the Library might be storing, right?
answered Feb 04 '11 at 01:19 AM
I've confirmed that dependencies between prefabs, or from a prefab to any asset, are stored in the Library. You can see this by examining a .prefab file with a hex editor (such as hxd), and you will see paths to Library files, with those great long GUID-like file names.
A prefab containing "pure data" components (numbers, strings, vectors, basic types) is fully self-contained and plays nicely with version control, but prefabs containing asset references do not.
I've got some ideas for a solution to this, but further experimentation is required.
answered Mar 04 '11 at 07:58 AM