


This is the minimum size of both windows.

This manipulator contains all of the event logic for this window.

This is the visual tree that contains the UI structure of the window. Public partial class DragAndDropWindow : EditorWindow Target.RemoveFromClassList("drop-area-dropping") Ĭreate the Editor windows and instantiate the manipulatorĬreate two custom Editor windows in a C# script and instantiate a manipulator for each Editor window.Ĭreate a C# file named DragAndDropWindow.cs with the following content: using UnityEditor Style the visual elements in a USS file.Ĭreate a Unity project with any template.Ĭreate a folder named drag-and-drop-across-window to store all the files.Ĭreate a UI Document named DragAndDrop.uxml with the following content: Ĭreate a style sheet named s with the following content. Each Editor window includes a background, a header, a drop area, and text. You can style the look, define the behaviour, and display it on screen as part of the UI. Before you start, get familiar with the following:ĭefine the content of each Editor window in a UXML file with built-in visual elements A node of a visual tree that instantiates or derives from the C# VisualElement class. This guide is for developers familiar with the Unity Editor, UI Toolkit, and C# scripting. You can find the completed files that this example creates in this GitHub repository Prerequisites You can also drag the same asset from one window to another. You can drag an asset from the Project window A window that shows the contents of your Assets folder (Project tab) More info See in Glossary into the Editor windows. The example creates two custom Editor windows. More info See in Glossary Toolkit’s drag events along with the UnityEditor.DragAndDrop class to enable drag-and-drop UI between windows. Unity currently supports three UI systems. This example demonstrates how to use UI (User Interface) Allows a user to interact with your application. target elements with the "draggable" class interact ( '.draggable' ).
