Unity_Raycasters

Raycasters
The Event System needs a method for detecting where current input events need to be sent to, and this is provided by the Raycasters. Given a screen space position they will collect all potential targets, figure out if they are under the given position, and then return the object that is closest to the screen. There are a few types of Raycasters that are provided:

  • Graphic Raycaster - Used for UI elements, lives on a Canvas and searches within the canvas
  • Physics 2D Raycaster - Used for 2D physics elements
  • Physics Raycaster - Used for 3D physics elements

When a Raycaster is present and enabled in the scene it will be used by the Event System whenever a query is issued from an Input Module.
If multiple Raycasters are used then they will all have casting happen against them and the results will be sorted based on distance to the elements.

翻译:
Raycasters
事件系统需要一种方法去检测当前输入事件需要发送到哪里,这是由Raycasters提供的。给定一个屏幕空间位置,它们将收集所有潜在的目标,判断它们是否在给定位置下,然后返回离屏幕最近的目标。这里提供了几种类型的Raycasters 。

  • Graphic Raycaster——用于UI元素,在画布和在画布的搜索里运行。
  • Physics 2D Raycaster——用于2D物理元素。
  • Physics Raycaster——用于3D物理元素。

当Raycaster出现并在场景中被启用时,它将被无论何时从输入模块发出查询的事件系统使用。
如果使用了多个Raycasters ,那么它们都将遇上反对投射的转换,结果将基于与元素的距离进行排序。

PS:
原文地址:https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/Raycasters.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Jennifer33K

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值