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

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.

主站蜘蛛池模板: 台州市| 罗田县| 安溪县| 龙胜| 东丰县| 西华县| 城口县| 荔波县| 仁布县| 鹤庆县| 柳江县| 娄烦县| 政和县| 鸡东县| 永济市| 中卫市| 罗山县| 宾阳县| 卢龙县| 云安县| 济宁市| 塔河县| 凤台县| 湖州市| 保德县| 柳河县| 咸宁市| 榆林市| 郎溪县| 南木林县| 会同县| 安乡县| 长阳| 长沙市| 镇远县| 页游| 连江县| 美姑县| 凌源市| 兖州市| 潜江市|