Y
Y
yraiv2022-01-28 19:02:16
Unity
yraiv, 2022-01-28 19:02:16

How to make it possible to buy objects by drag and drop?

It is necessary to implement the possibility of dragging objects from the panel to the field. How to do it? I made a store, when a person clicks on a button, a list of objects opens. And now I have several problems. First - what objects to use so that the user can drag them? I made the usual Panel, because I think that I just need the ability to drag the object to the right place and only then copy the coordinates and only after that spawn the prefab at this place. And the second - how to make the drag and drop of these same objects? And in general, am I doing the right thing, maybe it needs to be implemented somehow much easier?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2022-01-28
@yraiv

Those who are being dragged implement interfaces IDragHandler, IBeginDragHandler, IEndDragHandler
And the receiving sideIDropHandler

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question