Ejemplo n.º 1
0
 /// <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)));
 }
Ejemplo n.º 2
0
 /// <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));
 }
Ejemplo n.º 3
0
 /// <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)));
 }