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

Time for action – Find the Mesh Renderer component

Does renderer sound familiar to you? We already saw a component called Mesh Renderer when we created our Paddle and Ball Game Objects. If you don't remember, have a look at the following steps:

  1. Select the Ball, if you haven't already.
  2. Look in the list of the components of the Ball in the Inspector panel. There should be one component there called Mesh Renderer.
  3. If you see only the name of the component, click on the gray arrow next to the component name to expand the component.

Aha! What do we have here? Something called Mesh Renderer—it has a checkmark next to it. What happens if you click to uncheck that checkbox?

Go on—try it!

The ball disappeared. No surprises there. We saw something similar happen when we clicked on the checkmark beside an entire Game Object in the last chapter.

But, I wonder, does this Mesh Renderer component have anything to do with the "renderer" we talked about in our DisappearMe script? Checking that checkbox certainly seemed to have the same effect as running a script that said renderer.enabled = false;.

Let's be bold here. We need to figure this out. We'll leave the checkbox unchecked and modify our script to get a solid answer.

主站蜘蛛池模板: 安阳市| 得荣县| 南投县| 高密市| 岳阳县| 阳新县| 两当县| 宜川县| 湾仔区| 霸州市| 西丰县| 天镇县| 沁源县| 中卫市| 那坡县| 长岛县| 曲周县| 晴隆县| 根河市| 平安县| 阳西县| 新民市| 左贡县| 五大连池市| 鄄城县| 多伦县| 泰宁县| 白河县| 南澳县| 长治市| 太和县| 大埔县| 从江县| 卢湾区| 淳安县| 开江县| 无极县| 绥棱县| 临泉县| 永康市| 阿拉善右旗|