Author Topic: Prevent right mouse button from dragging UIDragObject  (Read 1760 times)

Wumpee

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 53
    • View Profile
Prevent right mouse button from dragging UIDragObject
« on: November 26, 2014, 03:49:57 PM »
What is the correct way to prevent the right mouse button from dragging an object with a UIDragObject component on it?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Prevent right mouse button from dragging UIDragObject
« Reply #1 on: November 26, 2014, 08:42:37 PM »
Modify the script and add a check at the top of its OnPress() function:
  1. if (UICamera.currentTouchID != -1) return;

Wumpee

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 53
    • View Profile
Re: Prevent right mouse button from dragging UIDragObject
« Reply #2 on: November 26, 2014, 08:56:54 PM »
Thanks, that's what I'm doing now. I just wasn't sure if there was a better way.