- Home /
I want to put my Unity project into a perforce server, how do I "clean" a unity project?
Hi
I would like to know how I might go about cleaning a Unity project to remove all the local generated files, and just leave the files that are necessary to re-generate the project (like when you "clean" a C++ project in visual studio).
Is there a definitive "what is temporary & what isn't" document anywhere, I've trawled all over the place and found nothing useful...
Cheers,
darbotron
Answer by nschrag · Mar 26, 2012 at 05:25 AM
If you are running Unity 3.5 or later, it's fairly simple. Under Edit > Project Settings > Editor, be sure Version Control Mode is set to Meta Files (available even in the free version starting with 3.5). Unity will then generate a .meta file for every file and folder in the Assets directory.
Everything in the Assets and ProjectSettings directories needs to be checked in, and you will be good to go. The Library directory will be recreated locally when someone else gets the project or updates to the project.
Answer by Chad · Mar 26, 2012 at 05:44 AM
The Unity 3.5 docs have a good description of the process for subversion.
Answer by zaino · Feb 02, 2013 at 09:47 PM
Hi guys, I want to put my project in P4 as well. I read the doc, but I have a couple of questions:
Steps 5, 6 and 9 seem redundant to me with P4. Can't I just delete Library (step 4) and then submit Assets and ProjectSettings as step 5? Step 7 will recreate Library, but it's a local folder, why would I need to re-commit after? I really don't get it.
Whenever I need to make modifications to a file, do I need to check out also the metafile associated with it?
Thanks!
The easiest way to work with P4 (assu$$anonymous$$g that you have set P4 to ignore the temporary folders) is to just do "reconcile offline work" on the project folder.
The meta files associated with each asset / folder don't necessarily change, but you should generally check them out just to be on the safe side if you're insisting on doing it manually - you can always set the workspace to "revert unchanged" on submit.
I've since switched to using git / mercurial for my projects & though I've been using P4 for a decade I've found that the workflow is way easier with mercurial - at least with small $$anonymous$$ms...
$$anonymous$$inor thing - P4 is definitely better for art heavy projects, git / mercurial don't scale particularly well with binary data. In fact I know several companies that use git for code & perforce for art assets for this reason.