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

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.

主站蜘蛛池模板: 湘潭市| 仙居县| 克什克腾旗| 共和县| 绥德县| 滨州市| 银川市| 新津县| 南康市| 斗六市| 福安市| 修文县| 株洲市| 曲周县| 孟津县| 洛隆县| 福建省| 柳州市| 饶阳县| 绥宁县| 巨野县| 义马市| 兴海县| 彰化县| 晋城| 伊通| 永寿县| 民丰县| 兰考县| 神农架林区| 清远市| 巩留县| 新和县| 无极县| 苏州市| 凤城市| 鹤壁市| 伊春市| 庆元县| 运城市| 茶陵县|