Code Convention - merlijn1411/PacMan3D GitHub Wiki

a class is always a PascalCase.

public class PascalCase

by methodes is it exactly the same and they are always verbs

private void PascalCase

I uses CamelCase for naming my Variables.

if the variable isn't called from another class or if you don't think you're gonna use it outside the class its automatically a private var. only public vars are written as a PascalCase

[serializefield] private string camelCase;

private string _camelCase;

public string PascalCase;

Code Convention conditions:

By If-statements: if the lines in the statements is not more than one don't use brackets


var result = true

  print("It works!")
  print("it didn't work") 

The reason why because its unnecessary to use brackets by one lined code statements and this is more readable.

another expression is to use ternary ? and :


int x = 10;
int y = 20;

int result = x > y ? x : y;

what i am saying here is that if x is higher than y then is x the result, but if x is lesser than y, y is then the result.