Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hi Alfie,

This is the style I generally use in my code:

- Serialised Member Fields (values specified in the inspector which shouldn't be edited runtime) Start with a capital letter and camel case

- Private Member Fields (values for tracking runtime state) Start with lowercase m and then camel case

- Locals (values that are local to the current scope) Start lowercase and then camel case

- Functions, enums, constants, etc Start with capital and then camel case

Basically anything that shouldn't change starts with a capital and things that can be changed start with an m to indicate that they are members or lowercase to indicate that the values are local to the current scope.

When I write code into an existing project, I usually try to copy the style that surrounds it so that it doesn't look out of place, therefore making the code neater and more readable.