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

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.

主站蜘蛛池模板: 阿巴嘎旗| 鲜城| 菏泽市| 龙游县| 永定县| 察雅县| 龙山县| 航空| 论坛| 浠水县| 溧阳市| 铜川市| 祁门县| 东港市| 金堂县| 沅陵县| 林口县| 喀喇| 辽阳县| 杭锦旗| 朝阳区| 襄垣县| 巴南区| 锡林浩特市| 扎囊县| 淮北市| 渑池县| 彰化县| 敦煌市| 韶山市| 东山县| 利辛县| 马边| 阿拉善右旗| 曲麻莱县| 会理县| 青岛市| 营口市| 新干县| 城口县| 黑龙江省|