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

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.

主站蜘蛛池模板: 红河县| 共和县| 宁武县| 富锦市| 广汉市| 玛曲县| 兴和县| 红安县| 三原县| 承德县| 杨浦区| 抚顺县| 杭州市| 彰化县| 平泉县| 新巴尔虎左旗| 塘沽区| 南宫市| 四子王旗| 四子王旗| 镇原县| 名山县| 惠东县| 天长市| 融水| 安龙县| 井冈山市| 永济市| 铜梁县| 台江县| 定远县| 巴塘县| 长泰县| 高尔夫| 宜阳县| 循化| 民乐县| 通江县| 富裕县| 淮阳县| 秦安县|