Contributing to Fungus for Unity – week 2

I decided I definitely want to stick with Fungus because of the reasons I mentioned in my previous post. But there were some features I wanted that weren’t already in the code base. What to do?? I would try contributing to the project!

The Setup

  1. Install Unity – I just downloaded the latest at the time which was 5.3.3. During the install make sure to install the visual studio tools.
  2. Install Visual Studio Community – For debugging, code completion and it’s just way nicer than Unity’s default editor.
  3. Install git – What? You don’t have it already? Weirdo.
  4. Configure git – Create and add your ssh-key, configure your local global environment, learn git, etc…

Ready the Repository

  1. Fork snozbot/Fungus.
  2. Before you start working on your feature, is it already listed in issues?
  3. git clone <your fork url>
  4. git remote add snozbot
  5. git remote pull snozbot master
    -get the most recent code.
  6. git push origin master
    -make sure your repository is up-to-date.
  7. Open Unity, open a project and navigate to your cloned fungus directory.
  8. Open Visual Studio, go to File->Open…->Project/Solution, navigate to your cloned fungus directory and open the sln.
  9. Run tests – in Unity…Unity Test Tools -> Platform Runner -> Run on Platform -> Build and run tests
    You want to make sure you’re working with a clean environment with passing tests before you start with your work.

Start the Work

  1. Go to a new branch
    git checkout -b <name of your feature>
  2. Code what you want! If you have questions, comment on the issue in github.
  3. To debug, in visual studio, click the button to Attach… and select Unity. Here’s some more info about debugging. I think saves soooo much time. Console Print statements take too long.
  4. Try to think of any scenario that might break your functionality and test it out-or make tests.

Write Tests

Test-driven development is a good practice. Writing your tests, seeing your tests fail and then writing the new feature to make the tests pass…yup…good practice. But I’m not entirely sure how to write the tests in Unity just yet. Once I figure that out, I’ll link the How-to here.

Submit a Pull Request

Submit your pull request and wait for input from someone from Snozbot. They might ask you to change things or give you pointers.

This is my first time submitting to a non-work project! Hopefully my pull-request gets pulled in!

Share on FacebookTweet about this on TwitterShare on RedditShare on TumblrPin on PinterestEmail this to someone

Leave a Reply

Your email address will not be published. Required fields are marked *