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

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.

主站蜘蛛池模板: 乌兰浩特市| 呈贡县| 木兰县| 承德县| 城步| 阿克苏市| 通辽市| 阜宁县| 闸北区| 肃南| 佛学| 兴业县| 连云港市| 东乡| 简阳市| 萨嘎县| 开阳县| 德州市| 武清区| 临猗县| 云南省| 蒙阴县| 荃湾区| 东源县| 绥江县| 二连浩特市| 洪江市| 北票市| 米易县| 屯留县| 高密市| 德兴市| 岚皋县| 辛集市| 平泉县| 乌海市| 镇江市| 汾阳市| 辉南县| 和静县| 霸州市|