Skip to content

Info

Tbd, for now just follow what is considered good practice for C#.

Naming conventions

TL:DR

Rule Convention Structure Prefix Postfix Example
Scripts PascalCase

- descriptive
- nouns

InstanceManager.cs
Types PascalCase
Type parameters PascalCase T
Interfaces PascalCase I IINterface

Classes

  • Use PascalCase for class names
  • Use descriptive class names

Example

C#
1
2
3
4
public class ItemDatabase
{
    ...
}

Fields (variables)

✔ Use camelCase for normal fields: speed health* ✔ Use underscore + camelCase for private fields: _speed, _health ✔ Use camelCase for class properties: verticalRotationOffset, verticalTransformOffset ✔ Use ALL_CAPS for data (playerprefs) fields: PLAYER_CURRENCY, PLAYER_NICKNAME. ✔ Use ALL_CAPS for constants: MIN_VALUE, MAX_VALUE.