예제 #1
0
 /// <summary>
 /// Converts the screen point to a world point using the transform's root
 /// camera. 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)
 {
     return(CameraUtils.ScreenToWorldPoint(point, transform, CameraUtils.FindRootCamera(transform)));
 }
예제 #2
0
 /// <summary>
 /// Converts the touch 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 TouchToWorldPoint(Touch touch, Transform transform, Camera camera)
 {
     return(CameraUtils.ScreenToWorldPoint(touch.Position, transform, camera));
 }