Asking for drag&drop example.

Hello all!

I want to do something like that http://www.youtube.com/watch?v=O4MECMEB_ks using onGUI. Could anybody give me some example, tutorial or articles that helps me to do it?

Thank you!

It’s a bit complex stuff, more easily done in the async domain. With ‘raw’ Unity - doable, but not so easy/out of the box. You got to have a bunch of flags for:

  • did user click the button
  • what was the position of the mouse
  • what was below the mouse
  • did user release the button
  • handling drag proxy (the image on top which follows the mouse)
  • etc.

The alternative is using the framework: http://edrivenunity.com/drag-drop