Rules I follow for every Unity project.
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| README.md | ||
General
- Don't use spaces when naming things
- Don't use any special characters when naming stuff(this includes other languages)
- Don't add any unnecessary files to the project directory, keep it clean and keep in mind that github offers limited space(2GB)
- When exporting models, pngs etc. there is no need to export them to the
Krita/Blenderdirectory, export them directly toAssets/AppropriateDirto avoid duplication - Every asset should have the proper suffix added to their name, an example would be
BackgroundImage.pnginstead ofBackground.png
Project Structure
ProjectName
├── Git
├── Builds
│ ├── Android
│ ├── Linux
│ └── Windows
└── Project
├── Blender
├── FLStudio
├── Krita
└── Unity
└── ProjectName
├── Assets
│ ├── Scripts *Divide into namespaces*
│ ├── Materials
│ ├── Sounds
│ │ ├── SFX
│ │ └── Music
│ ├── Sprites
│ ├── Prefabs
│ ├── Scenes
│ ├── Shaders
│ ├── VFX
│ ├── Animations
│ ├── Miscellaneous
│ ├── Models
│ └── Textures
├── Packages
└── ProjectSettings
Software
- Game Engine - Unity
- IDE - Optional
- Image Editing - Krita
- Modelling - Blender
- SFX/Music - Optional
C#
General
- Always use namespaces, you can add the current
classto the propernamespaceby placing cursor over theclass name, clickingctrl+.and adding it to the namespace - Add the type suffix to properties, fields and variables, example of that would be
playerTransforminstead ofplayer
Naming Conventions
- Namespace
CamelCase - Class
CamelCase - Private Field/Property
_camelCase - Public Field/Property
CamelCase - Method
CamelCase - IEnumerator
CamelCase+Routine - Coroutine
_camelCase+Routine - Parameters/Variables
camelCase
Declaration Order
- This is optional but if you don't have your own rules, follow this:
Constants
Private Fields
Public Fields
Serialize Fields
Private Properties
Public Properties
Unity Functions
Private Functions
Public Functions