- Home /
Git and .scene/.prefab
I am working on a project in unity3d that is collaborative. I have a few questions regarding git repository:
From what i've read, files asset serialisation mode should be Mixed but how does that actually work on .scene/.prefab? It kind of seems awful to not be able to work on the same scene/prefab simultaneously. Does it actually work?
Answer by fafase · Apr 23, 2014 at 11:47 AM
It works but it is not as easy as with scripts.
What you can do:
Create a scene
one user at a time modifies the scene and pushes
all other users pull and get the modification
What you cannot do:
Create a scene
All users make modifications
All users pull and push -> conflicts
It is possible to find ways, for instance, you can use the editor to place objects in your scene, once you found the proper place, you remove it and add it by script as script merge as supposed to.
Other way, you delegate work (this is how we do), where only the level designers can modify scenes. Programmers only program script. This way we barely get any issue.
Conflicts in scene gets fixed the same way as scripts, you open the scene file in notepad and look for the HEAD and >>>>>> and figured out which is good. Only problem is that it may require thousands of lines to be removed and it is YAML so even though you can easily read it you wont know what it does...
Does the integrated Version Control in Unity3d permit multiple users to commit to the same git scene? @fafase
I would think so. I am not using it so I cannot confirm anything apart the fact that it cost some $1500 and you need pro which is another $1500.
Answer by Valentin_B · Apr 23, 2014 at 01:46 PM
Not even the asset server can handle scene versionning/conflicts further than "discard server changes/my changes".
This is a big issue, since this feature is so expensive you'd think they'd have figured out a way to handle modifications within versionned scenes.
One workaround is to only work with separated scenes, and use AdditiveLevelLoading, having each collaborator working within one, and only one, scene.
Another workaround would be to use prefabs containing the entire work of each developper, prefabs that would be instantiated at runtime when the scene is opened.
Your answer
Follow this Question
Related Questions
Prefab is completly messed up 2 Answers
Passing a prefab between scenes? 1 Answer
Prefab looks different in different scenes 0 Answers
How to save all scene? 1 Answer
How do I select a prefab that was just instantiated from an editor window? 1 Answer