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

A leap of faith

The first piece of code (the first lines of our script) looks like this:

function Update () {
}

Click to place your cursor after the first curly bracket, and press the Enter key to make some space between the top and bottom curly braces. Press the Tab key to indent, to make your code look pretty, if the editor doesn't automatically do it for you. Then, type a single line of code so that your script looks like this:

function Update () {
   renderer.enabled = false;
}

Note

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

You will notice that as you type each word in this line of code, entire drop-down lists pop open with a dizzying list of strange-looking options. This is called Code Hinting, and while it may seem annoying when you first encounter it, you'll be erecting a shrine to it by the time you have finished this book. Code hinting brings a programming language's entire dictionary to your fingertips, saving you the hassle of looking things up or misspelling special keywords.

A little asterisk ("star") appears next to your script's name whenever you have unsaved changes. Save your script by pressing Ctrl + S or Command + S on the keyboard, or by choosing File | Save from the menu. For the remainder of this book, we'll assume that you've saved any modifications that you've made to your scripts before trying them out.

主站蜘蛛池模板: 阳信县| 南平市| 崇州市| 龙南县| 丰城市| 东阿县| 东光县| 和政县| 天水市| 贡觉县| 泸州市| 闻喜县| 同心县| 清流县| 正宁县| 孝感市| 密山市| 民丰县| 南陵县| 麦盖提县| 永修县| 石柱| 新蔡县| 天祝| 黄浦区| 西华县| 确山县| 淅川县| 璧山县| 安康市| 焉耆| 凤冈县| 崇明县| 吉林省| 福州市| 昌乐县| 化州市| 洛川县| 民勤县| 贺州市| 老河口市|