Coder Social home page Coder Social logo

unitylibraryswitcher's Introduction

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 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 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.

private static string ShellPath = @"C:\Program Files (x86)\Git\bin\sh";

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.

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.

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 Issues section.

More reading

You can find more information about this project in this blog post.

unitylibraryswitcher's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

unitylibraryswitcher's Issues

Unsupported target platforms

In the Select target drop-down list there are all build targets, even those user can’t switch to because of licence restrictions. I suggest to filter this list if it’s possible.

Add force update button

This button should force update following things:

  • list of branches
  • list of cached libraries and their info

List of Cached Libraries

We should show the list of cached library folders. I am not sure how to visualize it - the overall design is a matter of change in future, but think about following points.

  • List all cached directories.
  • Calculate size of each cached library directory.
  • Show total size of cache directory.
  • Make it possible to remove cached library from this list.
  • Show the date of cache creation, because sometimes it’s critical to know in order to make switch as fast as possible

Update screenshots

Now there is a list of cached stuff, so I should update screenshot. Also, the current one has a terrible quality.

Possible problems when editor fails to switch the target

Target switch process can fail because of following reasons.

  1. User cancels the process.
  2. Target platform is not available for user due to licence etc.

We can’t swap library folder after switching the target, because this process leads to recompilation and reimporting. We can’t foresee the failure of target switch, so in case of failure we should swap library back.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.