We mostly follow standard Google's C# style guide, because it's the most concise guide.
The key things to know:
PascalCase
for classes, methods, public fields, etc.camelCase
for local variables and parameters_camelCase
for private and protected class properties- 4 space indentation (vs 2 in Google's guide)
Don't worry about being pedantic around whitespace rules, where braces go, method ordering, etc.
These are prefab game objects from which in-game game objects are generated (anything that's duplicated). Enemies, Projectiles, etc.
From inside the Unity Editor, you can drag these prefab objects into the scene (make sure you're in Scene view) and they'll become game objects in the game.
This is where the main scene files are located. There are just two scenes:
TitleScene
- displays the title when the game launchesBattleScene
- the primary in-game scene (where the player fights enemies)
All the component C# scripts (read: the code for the game).
Sprites, art assets, tiles, materials, etc.
Music and sound effects.
- Make sure you save your Scene in the Unity Editor (CMD + S) before committing code. If you don't, all the scene data (e.g. the game objects, their components, and those components' properties) won't get persisted.
- When you add a new Script component inside Unity, it gets placed in the top-level
Assets
folder. You have to manually move the newly-created file toAssets/Scripts
. - When renaming or moving files, move/rename the files inside Unity Editor, not VS Code. Unity Editor will ensure any scripts that were attached to game objects also get renamed/mapped to the new location.
- If you perform the move/rename in VS Code, you'll have to manually add all the script references back inside Unity. See CONTRIBUTING.