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

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.

主站蜘蛛池模板: 宜春市| 阿尔山市| 江安县| 广安市| 特克斯县| 碌曲县| 沙坪坝区| 石泉县| 务川| 邵武市| 田东县| 墨竹工卡县| 古交市| 大石桥市| 隆回县| 濮阳县| 来安县| 蚌埠市| 通山县| 上饶市| 梅河口市| 将乐县| 株洲市| 灵山县| 建水县| 自治县| 万州区| 阳西县| 高邑县| 密云县| 威信县| 饶河县| 南宁市| 山阳县| 武川县| 成都市| 太仆寺旗| 安顺市| 勃利县| 松阳县| 邢台市|