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

It's all Greek to me

First, we created a JavaScript script. Unity scripts are written in three languages that are somewhat like English: JavaScript, C#, and Boo. You may have already dabbled in JavaScript if you've tried your hand at web development. Unity's version of JavaScript (called "UnityScript") is a bit different because it talks about Unity-related things and runs much faster than your father's JavaScript.

In this book, we'll use JavaScript because it's the simplest of the three languages to learn. For this reason, many of the online Unity scripting tutorials you'll find are also written in JavaScript.

Tip

Stay sharp

JavaScript may be the best learning language for Unity beginners, but if you end up getting serious about developing games with this software, consider learning C#. It's much closer to a "real" programming environment, and it gives you certain organizational advantages that you won't get with JavaScript.

The first thing that we did was to write a line of code between two curly braces. I like to think of curly braces as delicious sandwich buns that group code together. The single lines of code are like the thin layers of salami or tomato in the sandwich. Above the curly braces is the description, or declaration, of the sandwich. It's like saying: We are now going to make a hoagie—top sandwich bun, yummy ingredients, bottom sandwich bun.

In more technical, less sandwich terms, the area grouped by the buns is called a statement block. The layers between the buns are called statements. And the type of sandwich we're making, the Update sandwich, is known as a function.

主站蜘蛛池模板: 名山县| 区。| 宣化县| 岱山县| 祁门县| 锦州市| 伽师县| 松滋市| 永济市| 涟源市| 泰州市| 本溪| 竹山县| 大渡口区| 开平市| 石嘴山市| 含山县| 天水市| 崇义县| 丹江口市| 清水县| 嵊泗县| 桓台县| 腾冲县| 育儿| 金湖县| 进贤县| 五华县| 白水县| 巨鹿县| 三河市| 康平县| 金寨县| 二连浩特市| 淮阳县| 辉县市| 伊川县| 盖州市| 轮台县| 安顺市| 江西省|