M_* variable naming

I just wanted to point out that the reason the variables were declared as m_* (m_layerHit for example) is due to the fact that backing variables are required when using properties with custom getters and/or setters. This is why you were getting complications with renaming in Section 1 Lecture 20, TODO’s and bug fixes, at ~14 minute mark. m_layerHit was changed to something like currentLayerHit, which became the backing variable. I hope this is helpful to anyone who did not understand the issue!

The most confusing thing is, that the Unity naming convention goes against the naming convention for C#.

Here are the guidelines c#-programmers (should) follow:
https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/naming-guidelines

The correction in the Video still isn’t nice. Instead of naming layerHit property currentLayerHit. It should have been LayerHit with a big L.
Also the Name current is inappropriate because currentLayerHit always returns the same value as layerHit.

Privacy & Terms