- Learning C# by Developing Games with Unity 5.x(Second Edition)
- Greg Lukosek
- 116字
- 2021-07-09 20:03:35
Using multiword variable names
Let's use the same example again, as follows:
public bool areRoadConditionsPerfect = true;
You can see that the variable name is actually four words squeezed together. Since variable names can be only one word, begin the first word with a lowercase and then just capitalize the first letter of every additional word. This greatly helps create descriptive names which the viewer is still able to read. There's a term for this, called camel casing.
I have already mentioned that for public variables, Unity's Inspector will separate each word and capitalize the first word. Go ahead! Add the previous statement to LearningScript
and see what Unity does with it in the Inspector panel.
推薦閱讀
- Implementing Modern DevOps
- 編寫整潔的Python代碼(第2版)
- 看透JavaScript:原理、方法與實踐
- 信息安全技術
- Banana Pi Cookbook
- TypeScript實戰指南
- Microsoft Dynamics GP 2013 Reporting, Second Edition
- Python Data Analysis(Second Edition)
- Windows Forensics Cookbook
- 組態軟件技術與應用
- Hands-On Nuxt.js Web Development
- JavaScript程序設計(第2版)
- R語言數據可視化:科技圖表繪制
- Programming Microsoft Dynamics? NAV 2015
- Advanced UFT 12 for Test Engineers Cookbook