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

Time for action – Make the ball re-appear

  1. Double-click on the DisappearMe script. MonoDevelop will open up and display the script.
  2. Change the word false to true.
  3. Save the script.
  4. 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.

主站蜘蛛池模板: 达尔| 海林市| 盐边县| 阿坝县| 遂川县| 桃园县| 胶南市| 清徐县| 勐海县| 阳泉市| 德化县| 高碑店市| 长宁县| 漳浦县| 莱西市| 新蔡县| 六盘水市| 康平县| 固始县| 项城市| 洞口县| 环江| 东辽县| 汤阴县| 南城县| 宁陵县| 定安县| 于田县| 芮城县| 峨边| 蓬溪县| 丹江口市| 沁源县| 英吉沙县| 广南县| 澄城县| 大庆市| 运城市| 凤庆县| 太湖县| 旅游|