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

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.

主站蜘蛛池模板: 丹棱县| 武义县| 油尖旺区| 通化市| 新建县| 神农架林区| 正定县| 凉山| 公安县| 嘉禾县| 武鸣县| 大渡口区| 东兰县| 田阳县| 民权县| 龙胜| 马关县| 鄂托克前旗| 绵阳市| 呼伦贝尔市| 大化| 永新县| 荃湾区| 九江县| 元阳县| 璧山县| 邯郸县| 安徽省| 赫章县| 买车| 广丰县| 辉南县| 永城市| 桑日县| 滦南县| 中阳县| 本溪市| 彰武县| 乡宁县| 东乌珠穆沁旗| 崇阳县|