Skip to content

help_programming

Stuart Spence edited this page Mar 29, 2016 · 7 revisions

#Unity3D Programming

So you want to help? Awesome! It's always possible to grab our project and try doing whatever you like. But following this advice will make your code much more useful to us!

It's very important that our project doesn't get messy! If we don't pay attention to project organization, then progress will ground to a halt as adding new features will get harder and harder.

###Unity Settings When you first open the project in Unity, you may need to set "visible meta files" and asset serialization to "force text". To do this, select Edit, Project Settings, Editor, and changes the settings on the right.

###Component design pattern

Unity naturally uses a programming paradigm called component based design. This means that all our code is very "encapsulated". What does this mean?

Lets say I want to make a script that makes the player float to the surface. So you write a script called FloatToSurface.cs, and test it in a scene called "float test1". It works great! Awesome!

Now try this: delete every script in the unity project except FloatToSurface (and perhaps keep MouseLook too if you're using it, etc). Does your scene still work? If it does, that's excellent. That means your code is very encapsulated. Alternatively, it's also possible that you get a compile error, because your script requires other scripts. But in this case, it really shouldn't require other scripts.

To make your float script, you shouldn't change unrelated pieces of code at all, like FishSchool or VisionTracker. Imagine sometime in the future someone wants to completely change how FishSchool works - they shouldn't have to worry about floating to the surface! It's unrelated.

It's okay if you think doing this is hard. It's even okay to break this rule! But try your best to do it.

###What is there to do?

Have a look at our github issue tracker. Filter with the label "task:programming" to see all the programming work that can be done, like this.

###More Resources

If you're a decent programmer already and really interested in detailed Unity3D tips for programmers, I recommend this.

Clone this wiki locally