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

What's with the dots?

When you look at code written by others, you'll see words with periods separating them. What the heck is that? It looks complicated, doesn't it? The following is an example from the Unity documentation:

transform.position.x 

Don't concern yourself with what the preceding code means, as that comes later. I just want you to see the dots.

This is called dot syntax. The following is another example. It's the fictitious address of my house: UnitedKingdom, Bedfordshire, Sandy, 10MyStreet. Looks funny, doesn't it? That's because I used the syntax (grammar) of C# instead of the post office. However, I'll bet that if you look closely, you can easily figure out how to find my house. We'll get into much more at a later stage. For now, think of dot syntax as an address, starting from a big thing, a country in this case, and narrowing down to the most precise part that we want to access.

主站蜘蛛池模板: 云阳县| 宣恩县| 桐乡市| 瑞昌市| 景泰县| 常州市| 桐梓县| 长岭县| 乡城县| 哈巴河县| 尼木县| 饶河县| 电白县| 白银市| 乌什县| 连江县| 绍兴市| 邢台县| 原平市| 陆川县| 涪陵区| 瑞安市| 白玉县| 卢湾区| 沛县| 阿拉善左旗| 西平县| 汤阴县| 会昌县| 龙游县| 洛南县| 隆安县| 兖州市| 普陀区| 万荣县| 缙云县| 雅安市| 乌拉特后旗| 三原县| 岱山县| 荆门市|