官术网_书友最值得收藏!

Beginning variable names with lowercase

You should begin a variable name with a lowercase because it helps distinguish between a class name and a variable name in your code. There are some other guides in the C# documentation as well, but we don't need to worry about them at this stage. Component names (class names) begin with a capital letter. For example, it's easy to know that Transform is a class and transform is a variable.

There are, of course, exceptions to this general rule, and every programmer has a preferred way of using lowercase, uppercase, and perhaps an underscore to begin a variable name. In the end, you will have to decide upon a naming convention that you like. If you read the Unity forums, you will notice that there are some heated debates on naming variables. In this book, I will show you my preferred way, but you can use whatever is more comfortable for you.

主站蜘蛛池模板: 迁西县| 信宜市| 和顺县| 齐河县| 正镶白旗| 太保市| 仙桃市| 磐安县| 屏东县| 娄烦县| 正安县| 衢州市| 新安县| 丰原市| 六安市| 茂名市| 五华县| 怀柔区| 定襄县| 麻江县| 石城县| 海丰县| 云和县| 嵊泗县| 金湖县| 富宁县| 五家渠市| 都安| 贵阳市| 高淳县| 广灵县| 康定县| 砚山县| 湄潭县| 定兴县| 景宁| 高雄市| 炎陵县| 红安县| 林周县| 托克逊县|