Author Topic: BUG: The event of releasing LMB is missing  (Read 3085 times)

MrNixon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 4
    • View Profile
BUG: The event of releasing LMB is missing
« on: March 10, 2017, 03:55:23 PM »
Hi there,

We’ve faced some crucial bug while using NGUI for inventory.
When user click LMB on item (thus, holding it) and drag&drop it to the inventory fireld – everything works fine.
When user LMP on item (thus, hilding it) and release the button in a couple seconds – the item is drpped back and it works fine again.

BUT:
If user click LMP on item (thus, holding it) and release the button immediately (very swift) – the item is not dropped but holded up. The action of the LMB releasing does not tracked by the NGUI.

Could you assist? Or at least guide us what NGUI’s scripts to check for that?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: BUG: The event of releasing LMB is missing
« Reply #1 on: March 15, 2017, 01:06:41 PM »
I assume LMP is LMB, and "hilding" is "holding", and by "click" you meant "press" because a click is press and release, so there is no "hold" involved.

NGUI's drag & drop functionality has various means of starting the drag & drop operation, and you can change it on the script itself. When the drag & drop operation begins, the collider on the dragged object is supposed to be disabled, which is what makes it possible to drop the object on something else. Clicking on an item using NGUI's built-in scripts does not start the drag & drop operation at all. A click is just a click. You need to actually press and drag or press and hold the mouse for drag & drop to start. Did you write any custom code?