UnityGame/Library/PackageCache/com.unity.ugui/Documentation~/script-PanelRaycaster.md
2024-10-27 10:53:47 +03:00

1.2 KiB

Panel Raycaster

A derived Raycaster to raycast against UI Toolkit panel instances at runtime.

During the Start method of the EventSystem, a PanelRaycaster is automatically added to the scene for each active UI Document in the scene. To disable this behavior, call EventSystem.SetUITookitEventSystemOverride before the Start method executes.

You can use the Sort Order of the Panel Settings asset referenced by each document to configure the priority of the raycast between multiple documents. You can also use the PanelRaycaster in combination with a GraphicRaycaster. In that case, the Sort Order of documents is compared to the Sort Order of Canvases to determine overall priority.

For additional information about using input and event systems with UI Toolkit, refer to FAQ for event and input system.

Properties

Property: Function:
panel The panel that this component relates to. If the panel is null, this component has no effect. It will automatically be set to null automatically if the panel is disposed of from an external source.