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

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.

主站蜘蛛池模板: 葵青区| 阿拉善左旗| 顺平县| 开江县| 梁平县| 乐平市| 阿鲁科尔沁旗| 城步| 广河县| 遂宁市| 汝州市| 盱眙县| 马边| 武穴市| 巢湖市| 维西| 讷河市| 临潭县| 凤台县| 黄浦区| 石林| 惠安县| 清新县| 深泽县| 瓦房店市| 克拉玛依市| 静乐县| 邻水| 榆林市| 房产| 瓦房店市| 白城市| 海宁市| 铁岭市| 库尔勒市| 朔州市| 池州市| 上饶县| 东山县| 宜兴市| 临海市|