nTerra

Unity Drag & Drop Slots-Inventory

Many of you seasoned unity pros out there are probably face-palming as you look at how I’ve approached this, but this is the method that is working for me at this point. I’m sure it will be revised in the future.

The script below is attached to all of my quickslot UI images. I use an extra “phantom” slot (dragImage & dragText) to play the part of the slot that is being dragged. so the actual slots or slot items don’t move, the slot data is just passed behind the scenes. If you have any q’s  you can contact me dev@nuzly.com. otherwise, i hope this is useful in some way.

Also, check out this tutorial for a good run down on a variation of the code below. It’s the tutorial that clued me into this method, also check the unity forums for some useful unity 4.6 > 5 info. (which is where i got the UI raycasting stuff.)

Leave a Reply

Your email address will not be published. Required fields are marked *