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

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.

主站蜘蛛池模板: 九龙坡区| 山东省| 宿迁市| 保德县| 焉耆| 澎湖县| 石景山区| 雷波县| 南靖县| 会泽县| 临漳县| 天门市| 秀山| 田林县| 桐城市| 湖南省| 闽侯县| 雅江县| 荣昌县| 钟山县| 奇台县| 阳曲县| 巨野县| 巫山县| 宝兴县| 莎车县| 武功县| 舟曲县| 鄂温| 龙里县| 靖西县| 梁河县| 梁平县| 南城县| 阿城市| 饶河县| 北票市| 财经| 平潭县| 鲁山县| 西青区|