ドキュメント

Unity Engine

Unity Engine

ScreenPointToRay(Camera, Vector2)

Transforms a screen space position into a ray.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.UIModule
public static Ray ScreenPointToRay(Camera cam, Vector2 screenPos)

Parameters

The camera from which the ray originates. (Optional)

screenPos

The screen point.

Returns

Type

Description

RayThe ray going from camera through the screen point if the camera is given, or from the screen point going forward if no camera is given.