Search Unity

Unity and Open-Source

Last month at Unite, we announced our Open-Source initiative, where we will be opening the source to various components of Unity (along with other helpful tools and samples) in the future.  We announced the presence of the Unity Test Tools project at our new home on BitBucket and since then we’ve watched as our community has cloned, made forks, and submitted pull requests (you can see the development of the Test Tools happening in the repository itself and the project’s issue tracker being used as well).  Since then we’ve released our Xcode Manipulation API (allowing you to modify and adjust a generated Xcode project) and iOS Native Code samples (giving examples for things like how to integrate Unity with native UI and how to do native video rendering).  We’re also gearing up to ship you the source for our new UI shipping in 4.6 (which is currently in open beta) and we’re making plans to open the source to other components as well.

We also announced our Contributor’s Guide that is now part of our user manual.  Today, I’d like to go through those steps with you.

The Steps to Contributing

Our repositories are hosted on BitBucket under either Mercurial or Git.  If you’ve already contributed to a project on GitHub, the process is the same here.  If you’re coming from Perforce or SVN (or some other centralized version control system) and these concepts of ‘forks’ and ‘clones’ and ‘pushing’ and ‘pulling’ are all new to you, we encourage you to follow the steps in the contributor’s guide very closely (since they will guide you along with screenshots every step of the way) and also take advantage of the ‘Further Reading‘ section.

The first thing you need to do is get an account on BitBucket, which is where we are hosting our repositories.  This is a very straightforward process (f you’re completely new to BitBucket, but have a GitHub account, feel free to use that same account over at BitBucket, (EDIT: You need to create a BitBucket account first and connect your GitHub (or Google) account to it.  From then on, you will be able to login to BitBucket with your GitHub (or Google) account) and if you’re wondering why we are on BitBucket instead of GitHub, please see our FAQ.).

Next, you’ll want to make your way over to our home on BitBucket and find the repository you want to contribute to.  Once you’ve done that, you’ll want to fork the repository to your own space.  A fork of a a repository is simply a clone of a repository, that lives under your own space where you are free to push your own changes to.

Clone your fork and apply your changes.  Unless you love getting down and dirty on the command-line, we recommend SourceTree from Atlassian for interacting with both Mercurial and Git.  It will work for you whether you are on Mac or Windows, and whether you are using Mercurial or Git.

Finally, open a pull request from your fork and wait.  A Unity Developer will look at your pull request and process it, and if it’s approved, it will be merged into our repository.

In the end, the process looks like this:
DVCS Overview

What Happens to Pull Requests

When you submit a pull request, generally one of four things can happen:

  1. The pull request is accepted as-is and is merged in its entirety.
  2. The pull request is closed as rejected.
  3. The pull request is not closed as rejected, but the Unity Developer will require that you do some extra work before the change can be merged.
  4. The pull request is rejected, but the Unity Developer still applies some of the changes from the pull request.

Cases 1 and 2 are straightforward.  Case 3 usually means you need to do some cleanup or handle some extra cases.  Case 4 will usually happen if the Unity Developer doesn’t think all of the changes apply, but wants to take some of them, or if the history of the changes needs to be cleaned up before they can be applied.  In our Unity Test Tools project, we’ve already seen cases of 1, 2, and 4.

In all cases, you’ll be notified of activity on your pull request by mail, so be sure you are set up to receive email notifications from BitBucket.

There You Have It

So, in just a few relatively simple and straightforward steps, you can be helping to improve Unity and its ecosystem, both for yourself and the rest of the community!  As I’ve said before, we’re excited to see what you create.

16 replies on “Getting Started as a Contributor to our Open-Source Projects”

[…] Links Great News for PlayStation Developers! Getting Started as a Contributor to our Open-Source Projects Communication is a Game Development Skill […]

I think that is very good move. Many developer want be part of unity development. And that is right way to contribute.

Nice. But for it to be successful, it has to be visible. Over on UE4, it’s highly visible that you can get source, and contribute. To this end, I would recommend that Unity create a visible Unity Source link on the main site *and* forums, so that it’s very quick for new and old users to see this.

The blog post will vanish out of sight pretty quickly, and if the world is to contribute, it needs to find it :)

Nice. i know this was mentioned in the past, but GitHub is where it’s at, and it’s UI is simply better than BitBucket..

Common operations, such as searching for things in the repo based on keyword is so much easier (maybe not even possible in bitbucket?)

With that said, it’s still a nice move.

I’d certainly love to contribute to to the UI repo when it becomes available. Some changes I had in mind would be the ability to assign character arrays (with null terminator support) to the Text component.
Strings are one of the biggest weak points of C# IMHO, being able to optionally use a character array instead would be super helpful in reducing garbage generated. For instance, for text that I need to “type out” like a typewriter, I could easily manipulate a character array by inserting a null terminator at incrementing points in the array without generating any garbage.

@GARY, Not sure if I get your logic. I don’t remember seeing you saying thanks when they dropped the basic license fees for all platforms. And we can make money off them as well. I think if there’s anyone getting ripped off here it’s Unity Tech.

@Gary those components are for us free users too so stop complaining. No one is forcing anyone to commit any work against their will and open source is never about such $$ thing. If you are so narrow minded just keep your changes locally and stay away.

Since you’ll be getting developers to do free work for company, you should drop the price of Pro. Otherwise you are simply ripping people off and getting people to work for free while the company cashes in on their work.

Great news! As a developer I absolutely love Github and have been using it since University, so it’s wonderful that Unity developers now will be able to contribute to open source and lear easier!

Have you fixed the github login to bitbucket? I get a “Unfortunately you can no longer sign up using your GitHub account” after going all the way through the oauth signup. I reported this on Sept 4 in the Unity support forums.

Comments are closed.