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

Lick it and stick it

Return to Unity. You should still see your DisappearMe script in the Project panel. In order to attach it to the ball, drag-and-drop the file over the Ball Game Object in the Hierarchy panel. If drag-and-drop isn't your thing, you can also select the Ball Game Object, and choose Component | Scripts | Disappear Me from the menu. Once you do this, it may not look as if anything happened. To confirm that you did it correctly, click on the Ball. At the bottom of the Inspector panel where components of the Ball are listed, you should see your DisappearMe script.

Disappear Me!

Uncheck the Maximize on Play button in the Game view to experience the full effect of your script. (Cue circus music) And now, ladies and gentlemen, thrill to the astounding spectacle that you have created with a single line of code! Click on the Play button to test your game, and watch with amazement as your Ball disappears!

What just happened?

A good magician never reveals his tricks, but let's break down that piece of code we wrote to see what's going on behind the scenes.

主站蜘蛛池模板: 安国市| 景德镇市| 保德县| 勐海县| 广饶县| 突泉县| 吉木乃县| 改则县| 上高县| 河北区| 渭南市| 扬州市| 仁布县| 昌平区| 广元市| 荆州市| 临泽县| 崇义县| 古田县| 新龙县| 岳西县| 类乌齐县| 东辽县| 汉源县| 柏乡县| 枝江市| 凤冈县| 昌吉市| 洪洞县| 五大连池市| 晋中市| 海宁市| 淅川县| 南乐县| 横山县| 久治县| 花莲市| 陵川县| 黔南| 香河县| 崇明县|