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

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.

主站蜘蛛池模板: 临海市| 高邮市| 新河县| 柘城县| 义乌市| 阜新市| 手机| 天峻县| 波密县| 张家界市| 龙游县| 库车县| 胶州市| 盖州市| 项城市| 湟中县| 郯城县| 阳高县| 兴山县| 洛扎县| 阜宁县| 江达县| 东光县| 通化市| 天峨县| 庆城县| 精河县| 乌拉特前旗| 柏乡县| 浪卡子县| 格尔木市| 油尖旺区| 阿瓦提县| 灵台县| 庆城县| 库尔勒市| 聂荣县| 雷州市| 黄陵县| 垫江县| 遵义市|