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

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.

主站蜘蛛池模板: 湖口县| 宝应县| 佳木斯市| 蓬安县| 民权县| 开原市| 玛纳斯县| 乳源| 洱源县| 多伦县| 望谟县| 安泽县| 博乐市| 洞口县| 金华市| 马关县| 如东县| 大方县| 吉林省| 壤塘县| 潞城市| 麻江县| 堆龙德庆县| 得荣县| 桑日县| 密云县| 桐乡市| 云浮市| 浦县| 兴隆县| 金山区| 平和县| 大安市| 乌兰察布市| 高州市| 连州市| 梅州市| 奉新县| 汝城县| 贡觉县| 子洲县|