- 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.
推薦閱讀
- Vue.js 2 and Bootstrap 4 Web Development
- Visual Basic程序設計教程
- Learning Bayesian Models with R
- Windows Server 2012 Unified Remote Access Planning and Deployment
- 重學Java設計模式
- Python漫游數學王國:高等數學、線性代數、數理統計及運籌學
- 你不知道的JavaScript(中卷)
- Yocto for Raspberry Pi
- Learning Python Design Patterns
- SQL Server從入門到精通(第3版)
- RabbitMQ Cookbook
- HoloLens與混合現實開發
- Scratch趣味編程:陪孩子像搭積木一樣學編程
- Clojure Polymorphism
- 交互設計師成長手冊:從零開始學交互