ScreenToLocal() public static method

public static ScreenToLocal ( Vector2 screenPosition, Transform transform ) : Vector3
screenPosition Vector2
transform UnityEngine.Transform
return Vector3
Beispiel #1
0
        public static Vector2 ScreenToUv(Vector2 screenPosition, Transform transform, Sprite sprite, bool clamp)
        {
            Vector3 localPosition = Utility.ScreenToLocal(screenPosition, transform);
            Vector2 uvPosition    = Utility.LocalToUv(localPosition, sprite, clamp);

            return(uvPosition);
        }
Beispiel #2
0
        public static IntVector2 ScreenToPixel(Vector2 screenPosition, Transform transform, Sprite sprite, bool clamp)
        {
            Vector3    localPosition = Utility.ScreenToLocal(screenPosition, transform);
            Vector2    uvPosition    = Utility.LocalToUV(localPosition, sprite, clamp);
            IntVector2 pixelPosition = Utility.UVToPixel(uvPosition, sprite, clamp);

            return(pixelPosition);
        }