RectTransformUtility.ScreenPointToLocalPointInRectangle()
将一个屏幕空间点转换为 RectTransform 的本地空间中位于其矩形平面上的一个位置。
cam 参数应为与此屏幕点关联的摄像机。对于设置为 Screen Space - Overlay 模式的 Canvas 中的 RectTransform,cam 参数应为 null。
当从提供 PointerEventData 对象的事件处理程序中使用 ScreenPointToLocalPointInRectangle 时,可以通过使用 PointerEventData.enterEventData(对于悬停功能)或 PointerEventData.pressEventCamera(对于单击功能)获取正确的摄像机。这会为给定事件自动使用正确的摄像机(或 null)。