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

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.

主站蜘蛛池模板: 金湖县| 基隆市| 元江| 正定县| 汤原县| 新邵县| 南雄市| 江安县| 巩义市| 遂宁市| 宁乡县| 涡阳县| 乌拉特中旗| 锡林浩特市| 天水市| 区。| 柳林县| 珠海市| 万荣县| 山阳县| 涟水县| 永寿县| 咸阳市| 乡宁县| 西平县| 商南县| 新营市| 林甸县| 南城县| 名山县| 麻江县| 平度市| 遂川县| 保靖县| 沅陵县| 玉山县| 永丰县| 赣榆县| 辽源市| 兴安盟| 嵊州市|