3

I have several Unity Pro (4.5), and all of these projects need to share a common SVN repository of assets. This mainly includes scripts, but it may have other assets too.

Initially, I set this up by using svn:external properties on the appropriate directories. However, this doesn't work. Because the *.meta files are generated per project. I can't commit the *.meta files in the shared repositories for this reason. This ultimately causes asset references to be broken.

How can I go about creating a shared external repository between multiple Unity projects correctly? Is it even possible with how Unity handles *.meta files?

Zeenobit
  • 4,954
  • 3
  • 34
  • 46
  • Check out the [docs](http://docs.unity3d.com/Manual/ExternalVersionControlSystemSupport.html) if you haven't already. I think you should be uploading .meta files too. – Andy Mar 19 '15 at 22:22
  • @Andy I already went through that, and that's how I've set up the project. However, does this mean I should commit the *.meta files into the external, shared repository as well? Wouldn't meta files be changed across projects? – Zeenobit Mar 20 '15 at 20:40

1 Answers1

2

The meta files are necessary for asset references. They give assets their guids, which are used in serialisation of scenes and prefabs and such. So if you put a scene or prefab in a repository, then every referenced asset should have their meta files committed too. If you don't then Unity will generate new metafiles for your assets and give them random guids, breaking all references.

So your common repository must contain the metafiles of all the assets it contains. If you haven't done this from the beginning then you should start now. Open one of the projects, fix any broken references and commit all the metafiles along with any other changes to objects that belong in the common repository. Then, in every other project that uses the common repository pull and overwrite everything. If any broken references show up now then they should only be from local scenes. Fix those too.

Now, for your next project you can simply pull everything including metafiles. Unity will use the guids that the metafiles tell it to use and all references will be intact.

Tubeliar
  • 836
  • 7
  • 20
  • Committing the *.meta files seems to be working for us so far. I was under the impression that Unity changes *.meta files if you switch projects. But that doesn't seem to be case. Thank you for clarification! – Zeenobit Mar 26 '15 at 14:30