Class WorldDocumentRaycaster
A derived BaseRaycaster to raycast against UI Toolkit world-space document instances at runtime.
Inheritance
WorldDocumentRaycaster
Inherited Members
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Object.GetEntityId()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Namespace: UnityEngine.UIElements
Assembly: UnityEngine.UI.dll
Syntax
[AddComponentMenu("UI Toolkit/World Document Raycaster (UI Toolkit)")]
public class WorldDocumentRaycaster : BaseRaycaster
Properties
camera
The camera used by this Raycaster to convert screen coordinates to Rays. If empty, Camera.main is going to be used.
Declaration
public Camera camera { get; set; }
Property Value
Type | Description |
---|---|
Camera |
eventCamera
The camera that will generate rays for this raycaster.
Declaration
public override Camera eventCamera { get; }
Property Value
Type | Description |
---|---|
Camera |
Overrides
Methods
GetWorldRay(PointerEventData, out Ray, out float, out int)
Creates a ray from a given pointer event, according to this raycaster's properties. Also allows the raycaster to constrain the distance and layers that the ray can use.
Declaration
protected virtual bool GetWorldRay(PointerEventData eventData, out Ray worldRay, out float maxDistance, out int layerMask)
Parameters
Type | Name | Description |
---|---|---|
PointerEventData | eventData | Current event data. |
Ray | worldRay | The created ray. |
float | maxDistance | A distance constraint for the created ray. |
int | layerMask | A layer constraint for the created ray. |
Returns
Type | Description |
---|---|
bool | Returns true if a valid ray could be created. |
Raycast(PointerEventData, List<RaycastResult>)
Raycast against the scene.
Declaration
public override void Raycast(PointerEventData eventData, List<RaycastResult> resultAppendList)
Parameters
Type | Name | Description |
---|---|---|
PointerEventData | eventData | Current event data. |
List<RaycastResult> | resultAppendList | List of hit Objects. |