Version: 2022.3

RectTransformUtility.RectangleContainsScreenPoint

切换到手册
public static bool RectangleContainsScreenPoint (RectTransform rect, Vector2 screenPoint, Camera cam);

参数

rect 要测试的 RectTransform。
screenPoint 要测试的屏幕点。
cam 从其执行测试的摄像机。(可选)。

返回

bool 如果点在矩形内,则为 true。

描述

此 RectTransform 是否包含从给定摄像机观察到的屏幕点?