UnityLibrarySwitcher icon indicating copy to clipboard operation
UnityLibrarySwitcher copied to clipboard

Unity plugin for switching build targets, git branches without endless assets reimport. Not maintained anymore.

  • Unity Library Switcher

Unity Library Switcher is a Unity3d plugin for switching build targets and git branches without the burden of assets reimporting.

** Install

In order to install =UnityLibrarySwitcher= you have two options. First one is to download [[https://github.com/d12frosted/UnityLibrarySwitcher/releases/download/v0.1/UnityLibrarySwitcher.unitypackage][unitypackage]] file and open it. Second option is to clone this repository or download sources and copy =UnityProject/Assets/UnityLibrarySwitcher= folder to your project assets folder. Just don't forget to add =LibrarySwitcherCache= folder to =.gitignore= file.

For Windows users this plugin is working but not as perfect as on OS X. =UnityLibrarySwitcher= needs path to =bash= or =sh= that already is configured to work with =git=. By default it assumes that you have installed [[https://desktop.github.com][GitHub Client]] to =C:\Program Files (x86)\Git=. In case it's not what you are using - feel free to change following line in =MonoBasher.cs=.

#+BEGIN_SRC csharp private static string ShellPath = @"C:\Program Files (x86)\Git\bin\sh"; #+END_SRC

In case you want to improve things on Windows - pull requests are highly appreciated.

** How it works

You have two actions:

  1. switch build target
  2. switch git branch

Both actions are available from the plugin window, which is accessible from =Window/Library Switcher= menu.

[[file:images/screenshot1.png]]

=Library= folder is cached for every =(branch, target)= pair. When you perform any action, the plugin will cache =Library= folder for current =(branch, target)= pair and then replace =Library= folder by the cached library of selected =(branch, target)= pair if it exists. To make things work faster plugin copies =Library= folder only in case you are moving to the =(branch, target)= pair that wasn't cached before. If it was already cached, then plugin just moves directories around. All cached =Library= folders are stored in =LibrarySwitcherCache= folder in unity project root directory. =(branch, target)= pair's =Library= folder is stored at =LibrarySwitcherCache/branch/target=.

[[file:images/in_action.gif]]

** Limitations

  • Due to the implementation details you should change build target or git branch only from the plugin window. Otherwise you will run into unnecessary imports.
  • Branch switching only works with locally existing branches.

** Contributing

Pull requests, feature requests are warmly welcome!

** Issues / Tasks

Please, see [[https://github.com/d12frosted/UnityLibrarySwitcher/issues][Issues]] section.

** More reading

You can find more information about this project in [[http://d12frosted.github.io/posts/UnityLibrarySwitcher-v0.1.html][this blog post]].