- Unity 3.x Game Development by Example Beginner's Guide
- Ryan Henson Creighton
- 139字
- 2021-04-02 18:34:12
Time for action – Make the ball re-appear
- Double-click on the DisappearMe script. MonoDevelop will open up and display the script.
- Change the word
false
totrue
. - Save the script.
- Click on the Play button to test your game.
Your script should look like this:
function Update () { renderer.enabled = true; }
Bingo! The Ball started out invisible and then magically appeared. That means that the Mesh Renderer component and the renderer that we referred to in our script are the same thing. And the checkbox in the Inspector panel is actually the enabled
property in checkbox form—instead of true
and false
, it shows us checked and unchecked states! In fact, you can even keep an eye on the checkbox when you click on Play and see it change states. That tingling sensation means it's working.
推薦閱讀
- C++面向對象程序設計(第三版)
- Embedded Linux Projects Using Yocto Project Cookbook
- C++ Primer習題集(第5版)
- 案例式C語言程序設計
- JavaScript+DHTML語法與范例詳解詞典
- 深入理解Android:Wi-Fi、NFC和GPS卷
- Microsoft Azure Storage Essentials
- Everyday Data Structures
- C#面向對象程序設計(第2版)
- Drupal Search Engine Optimization
- C/C++代碼調試的藝術
- Improving your Penetration Testing Skills
- Swift從入門到精通 (移動開發叢書)
- Mastering VMware vSphere Storage
- Microsoft Azure Security