Join Jesse Freeman for an in-depth discussion in this video Drag-and-drop support in a window, part of Building Custom Tools to Extend the Unity IDE.
- [Voiceover] The last thing I want to cover…is how to support drag and drop inside of our test window.…Let's go ahead and open up…the test window code in MonoDevelop.…Below our OnGUI, let's go ahead and create a new method.…We're going to call this DropAreaGUI.…Now inside of our DropAreaGUI,…we're going to want to get a reference to the current event.…Let's go ahead and create a new variable called e.…We're going to set it equal to the Event.current.type.…
Next, we're going to want to test if e is equal…to the EventType class and we'll look for the drag update.…One thing to note is that it's very important…to choose the correct property.…Here, we're going to do DragUpdated…starting with a capital D.…Now, inside of this, let's go ahead…and change the DragAndDrop's visual mode…to let the cursor reflect that we're about…to accept dragging onto the actual window.…We'll call the DragAndDrop class directly…and set the visualMode to equal…DragAndDropVisualMode.Copy enum.…
We'll select it from the autocomplete list down below.…
- Exposing variables to the Inspector
- Providing attributes to Inspector fields
- Extending the base editor
- Creating custom UI elements
- Modifying the layout of a custom editor
- Building a custom window
- Saving and loading data
- Creating a reorderable list
- Skinning custom inspectors
- Exporting assets as Unity packages
Skill Level Intermediate
Unity 5: 2D Essential Training (2015)with Jesse Freeman3h 22m Intermediate
Unity 5: 2D Generate Procedural Terrainwith Dan Violet Sagmiller4h 4m Intermediate
Game Design Careers with Brenda Romerowith Brenda Romero54m 41s Beginner
1. Introduction to the Inspector
2. Build Custom Editors in Unity
3. Create Custom UI Elements in Unity
4. Build a Custom Window in Unity
5. Saving and Loading Data in Unity
6. Advanced UI
7. Skinning Custom Inspectors
8. Export Custom Code
Code organization4m 35s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.