UnityEngine.RectTransformUtility.ScreenPointToLocalPointInRectangle C# (CSharp) Method

ScreenPointToLocalPointInRectangle() public static method

public static ScreenPointToLocalPointInRectangle ( RectTransform rect, Vector2 screenPoint, Camera cam, Vector2 &localPoint ) : bool
rect RectTransform
screenPoint Vector2
cam Camera
localPoint Vector2
return bool
        public static bool ScreenPointToLocalPointInRectangle(RectTransform rect, Vector2 screenPoint, Camera cam, out Vector2 localPoint)
        {
            Vector3 vector;
            localPoint = Vector2.zero;
            if (ScreenPointToWorldPointInRectangle(rect, screenPoint, cam, out vector))
            {
                localPoint = rect.InverseTransformPoint(vector);
                return true;
            }
            return false;
        }