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

Time for action – Writing your first Unity script

Let's open our keep-up game project from the previous chapter, if it's not open already. We will write a really simple script and stick it to our Ball Game Object.

In the Project panel, right-click on an empty chunk of space and choose Create | JavaScript. Alternatively, you can click on Assets | Create | JavaScript in the menu at the top of the screen, or use the Create button at the top of the Project panel. A new script is added to the Project panel, inviting you to type a name for it. Name the script as "DisappearMe". It's also a good idea to use the same Create menu to make a folder and name it "Scripts", then drag your new DisappearMe script into it to keep your Project panel organized.

A brand new window opens up. This is Unity's default script editor, called Monodevelop. Its main panel looks a lot like a basic text editor because that's all that scripts really are—plain old boring text.

Note

Rolling your own

If you have your own favorite script editor, you can configure Unity to launch it instead. But, for the remainder of the book, we'll use the default editor.

主站蜘蛛池模板: 通州市| 九寨沟县| 修武县| 江口县| 扬州市| 武清区| 金秀| 措美县| 海门市| 贵南县| 老河口市| 金塔县| 镇江市| 高台县| 当阳市| 边坝县| 综艺| 自治县| 马鞍山市| 廊坊市| 浦县| 铁岭县| 田东县| 临桂县| 都兰县| 镇雄县| 禹州市| 从化市| 宜良县| 静海县| 漳浦县| 浦北县| 聂拉木县| 托里县| 阿拉尔市| 阿巴嘎旗| 和硕县| 阿坝县| 广东省| 长葛市| 易门县|