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!
- 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.
- Install Visual Studio Community – For debugging, code completion and it’s just way nicer than Unity’s default editor.
- Install git – What? You don’t have it already? Weirdo.
- Configure git – Create and add your ssh-key, configure your local global environment, learn git, etc…
Ready the Repository
- Fork snozbot/Fungus.
- Before you start working on your feature, is it already listed in issues?
- git clone <your fork url>
- git remote add snozbot https://github.com/snozbot/fungus.git
- git remote pull snozbot master
-get the most recent code.
- git push origin master
-make sure your repository is up-to-date.
- Open Unity, open a project and navigate to your cloned fungus directory.
- Open Visual Studio, go to File->Open…->Project/Solution, navigate to your cloned fungus directory and open the sln.
- 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
- Go to a new branch
git checkout -b <name of your feature>
- Code what you want! If you have questions, comment on the issue in github.
- 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.
- Try to think of any scenario that might break your functionality and test it out-or make 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!