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

Graphic Raycaster component

The Graphic Raycaster allows you to check to see whether objects on the Canvas have been hit by a user input using the EventSystem. As discussed when looking at the World Space Canvas Render Mode, when a user touches the screen, a ray is cast forward from the point on the screen at which the player touches. The Graphic Raycaster checks these rays and sees if they hit something on the Canvas.

You can adjust the following properties on the Graphic Raycaster component:

  • Ignore Reversed Graphics: If a UI element is facing away from the player, having this selected will stop the hit from registering. If it is not selected, hits will register on back-facing UI objects.
  • Blocking Objects: This setting specifies which types of items in front of it will block it from being hit. So, if you select Two D, any Two D object in front of the items on this Canvas will stop the items from being interacted with. However, 3D objects will not stop the interaction. The possible options are shown here:
  • Blocking Mask: Selecting items on this property works similar to the Blocking Objects property. This allows you to select items based on their Rendering Layer, so you can get a little more specific. The possible options are shown as follows:

We will discuss Raycasting and the EventSystem more thoroughly in Chapter 4, The Event System and Programming for UI.

主站蜘蛛池模板: 晋州市| 永平县| 固安县| 嘉善县| 新宁县| 衡阳县| 乳山市| 繁昌县| 嘉定区| 叶城县| 电白县| 新建县| 和政县| 延寿县| 慈溪市| 岳池县| 曲沃县| 榕江县| 林西县| 天长市| 津市市| 尼玛县| 方山县| 阜新市| 资中县| 武功县| 深圳市| 务川| 邹城市| 宁津县| 衡山县| 嘉禾县| 自贡市| 遵义市| 通城县| 来宾市| 荥经县| 水富县| 武义县| 梧州市| 甘泉县|