Working with multiple versions of Unity3D installed

As the number of projects you work on increases or you start to use betas such as the current Unity 4.6 betas you may find it useful to have multiple versions of unity installed on your machine at once. Fortunately this is very easy to do. You can even run multiple versions at once.

Installation

Mac: On the Mac Unity always installs into the Applications/Unity folder. Once installed you can just rename the Unity directory to reflect the version installed. Or as I do when I install a new version I rename my existing Unity directory to reflect it’s version.

PC: If you’re using a PC then it’s nice and simple when you install you get to select the install directory allowing you to install different versions in different directories. Note that you specify the directory for the Editor when installing and Unity will also install Monodevelop into the parent of the install path, ie C:\Program Files (x86)\Unity454F1\MonoDevelop when C:\Program Files (x86)\Unity454F1\Editor\ is specified:

UnityPCInstall

Just like on the Mac you can also rename the directory that unity is installed to after an install and everything continues to work.

Reverting to an older version of unity.

Occasionally when you load a project into a newer version of unity it will update some files within the project making it incompatible with earlier versions. Usually though this can be worked around as it’s often just a new project setting or change to the cache files. So to ensure that the project can be migrated between versions with maximum compatibility I do the following:

Enable Meta Files

[ezcol_1half]Edit->ProjectSettings->Editor:[/ezcol_1half] [ezcol_1half_end]MetaFiles[/ezcol_1half_end]

[expand title=”What are meta files?”]Meta files store the inspector settings and a unique identifier for each asset in your project, without meta files unity stores this information in the Library folder within your project which is just a cache of the imported data. We need to be able to delete the library folder when moving back a version of unity so we enable meta files so that unity can regenerate the library folder.[/expand]

Quit Unity

Delete Unity Created Files

Before doing this you must ensure you have meta files enabled within unity or you will destroy your project. If you’re not sure make a backup of the project first!
Unity creates several files automatically but all your project actually needs is the contents of the Assets and ProjectSettings folders, so you can delete all the other files and directories (unless you added them yourself, for example I often have a Data directory and Builds Directory here)

TempFiles

Start Unity

Now just start the version of unity you want to use and load the project. This will work most of the time unless you made code changes to your project to make use of a new set of APIs etc.

On rare occasions…

Occasionally though the above may still fail you and if it does the easiest way is usually to use your source control software to switch to the version that worked in that version of unity or to use a diff tool to see what changes unity made in your files.

Sometimes unity adds extra options and hence the project settings may not be backward compatible, you could just copy the old settings from before you upgraded or take a look at the files themselves.

To help in these scenarios I use text based asset serialization (Edit->ProjectSettings->Editor) allowing me to load the project settings and other assets into a text editor and remove the offending new option / change.

Leave a Reply