【ugui-1】RectTransformUtility

public static bool ScreenPointToLocalPointInRectangle(RectTransform rect, Vector2 screenPoint, Camera cam, out Vector2 localPoint);

desc:屏幕坐标  -->  局部坐标

return :表示该方法是否可以将屏幕坐标转换为本地坐标。是,则会返回true;否,则会返回false

 相关链接:transformation - Unity RectTransformUtility.ScreenPointToLocalPointInRectangle - Game Development Stack Exchange

     【Unity API 翻译】UGUI 屏幕坐标转UI坐标方法 – ScreenPointToLocalPointInRectangle() - 知乎 (zhihu.com) 的Josh Xiong的评论

public static bool RectangleContainsScreenPoint(RectTransform rect, Vector2 screenPoint);
public static bool RectangleContainsScreenPoint(RectTransform rect, Vector2 screenPoint, Camera cam);

desc:rect这个区域是否包含屏幕上的某一点

   两个参数的方法用于Screen Space - Overlay模式

   三个参数的方法用于Screen Space - Camera模式和World Space模式

return :true || false

原文地址:https://www.cnblogs.com/junple/p/12690921.html