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

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.

主站蜘蛛池模板: 佛冈县| 若羌县| 沙坪坝区| 海淀区| 尼勒克县| 和平区| 元朗区| 华亭县| 张家界市| 杭锦旗| 汉源县| 哈密市| 建昌县| 陆川县| 永昌县| 交口县| 南靖县| 博兴县| 仪陇县| 彰化县| 收藏| 赞皇县| 镶黄旗| 扬州市| 桐庐县| 安阳县| 楚雄市| 中卫市| 湘潭市| 南召县| 颍上县| 荆州市| 湘乡市| 通许县| 盐城市| 和顺县| 庆城县| 来宾市| 双城市| 陵水| 陵水|