Jump to content

Add drag event dynamically?


Recommended Posts

I was wondering if there are some examples of adding onDragStart and onDragStop events dynamically once a condition is met?

The picture shows the asked functionality:


I press  "The Horizontal baffle" button, and by doing that, a horizontal handle is added on screen following the mouse cursor. Currently the handle is moved directly with (x, y) coordinates on update, so no drag events included.

I should be able to start dragging my handle and when I stop drag or release the handle it should add new shelve.

Currently I am checking gameObject.input.mousePointer.isDown state and add shelve when mouse is released. But this is just not enough.

Are there some examples of this complete functionality. I am just tired of hacking and trying non-sense solutions :D


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...