What sort of naming-conventions are you guys using to help keep your variable names clear. For example, I’m often holding local references for the following common types of objects:
- Transforms
- Script Components
- GameObjects
And those can get confusing. For example, let’s say I instantiate a player. I now have a variable for the player’s gameObject, transform, and the script component. Without a good naming convention, a variable like “player” really doesn’t tell you much. If I come back and look at that variable in a week’s time, I won’t know if it’s the player’s transform, gameobject, or script that’s being referred to. Sure, there’s typecasting, but I find it’s not enough.
Has anyone developed a good naming convention for this? Like:
player_s = script
player_o = object
player_t = transform
I’m just wondering about best coding practices, cause as my project balloons, I find myself relying on them more and more to keep things sane.