- 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.
推薦閱讀
- 大話PLC(輕松動漫版)
- 多媒體CAI課件設計與制作導論(第二版)
- Unity 2020 By Example
- C++ Builder 6.0下OpenGL編程技術
- Magento 2 Theme Design(Second Edition)
- WSO2 Developer’s Guide
- 深入淺出Windows API程序設計:編程基礎篇
- 零基礎學Java程序設計
- 大學計算機基礎(第2版)(微課版)
- 零基礎學Python網絡爬蟲案例實戰全流程詳解(入門與提高篇)
- MySQL從入門到精通(軟件開發視頻大講堂)
- SQL Server數據庫管理與開發兵書
- Test-Driven Development with Django
- 深入理解C指針
- 編寫高質量代碼:改善Objective-C程序的61個建議