2D Demo Scene

Play around with the simple demo scene to quickly understand the drag and drop function.

1. Open The DemoScene and Play It~

Path = [Assets/DragAndDrop/DemoScene/Simple Drag and Drop/DemoScene.unity]

DemoScene.unity

2. Demo Video - How To Add a Dragable Object

https://www.youtube.com/watch?v=RapRP0iHV5I

3. Demo Video - How To Add a DropSlot Object

https://www.youtube.com/watch?v=1fZ-WWdhdV4

- Drag and Drop Event Description -

You can simply add a new custom Drag and Drop Event in the inspector! Yeah!

Example Function Usage:

- DropSlotDemo Inherient Description -

For more advance usage, you can write your own drop function by simply inherient the DropSlot script.

For example in the demo scene, we write a DropSlotDemo script which inherent the DropSlot, then override the OnDrop function.

You can get the info of the drag object by casting the DropObj.m_ObjInfoComponent.

Then, do whatever you want.

For example, we call an Initialize function which replace the slot image to the draggable object image.

Last updated

Was this helpful?