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

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.

主站蜘蛛池模板: 梁平县| 广安市| 连云港市| 左权县| 宝鸡市| 红安县| 罗源县| 正蓝旗| 绍兴市| 阜新| 渝中区| 新邵县| 巴里| 靖远县| 修武县| 延安市| 金门县| 濮阳市| 安陆市| 普安县| 镇沅| 静乐县| 宜丰县| 浮山县| 永州市| 茶陵县| 长宁区| 保山市| 江达县| 天津市| 连山| 乌审旗| 台安县| 宿州市| 锡林浩特市| 万州区| 灵川县| 漯河市| 平阳县| 南雄市| 普兰店市|