/// <summary> /// Converts the screen point to a world point. The distance from the camera /// to the world point will be the same as the distance from the camera to /// the transform along the z axis. /// </summary> public static Vector3 ScreenToWorldPoint(Vector2 point, Transform transform, Camera camera) { return(camera.ScreenToWorldPoint(CameraUtils.ScreenToCameraPoint(point, transform, camera))); }
/// <summary> /// Converts the touch to a camera point, where the z coordinate is the /// distance from the camera to the transform on the z axis. /// </summary> public static Vector3 TouchToCameraPoint(Touch touch, Transform transform, Camera camera) { return(CameraUtils.ScreenToCameraPoint(touch.Position, transform, camera)); }
/// <summary> /// Converts the screen point to a camera point using the transform's root /// camera, where the z coordinate is the distance from the camera to the /// transform on the z axis. /// </summary> public static Vector3 ScreenToCameraPoint(Vector2 point, Transform transform) { return(CameraUtils.ScreenToCameraPoint(point, transform, CameraUtils.FindRootCamera(transform))); }