Skip to content

Instantly share code, notes, and snippets.

@AdPetrou
AdPetrou / WorldSpaceUIDocument.cs
Last active January 26, 2023 13:56 — forked from katas94/WorldSpaceUIDocument.cs
Custom Unity component to create a world-space UIToolkit panel
using System.Collections.Generic;
using UnityEngine.EventSystems;
using UnityEngine.Rendering;
namespace UnityEngine.UIElements
{
public class WorldSpaceUIDocument : MonoBehaviour, IPointerMoveHandler, IPointerUpHandler, IPointerDownHandler,
ISubmitHandler, ICancelHandler, IMoveHandler, IScrollHandler, ISelectHandler, IDeselectHandler, IDragHandler
{
[Tooltip("Width of the panel in pixels. The RenderTexture used to render the panel will have this width.")]