Author Topic: Sticky Press seems always on (Upgrading from 2.3.6 to 2.6.3)  (Read 4284 times)

juggernate

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 21
    • View Profile
I had sticky press OFF so I could slide my finger across a number of objects (sort of like piano keys) without having to press each one with separate press events. This was working while I was on 2.3.6.

Now after upgrading to 2.6.3, I still have Sticky Press OFF on the UICamera, but I can no longer slide across the objects, I have to tap each object individually for the OnPress event to fire. Now it behaves the same whether I turn Sticky Press ON or OFF. :(

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Sticky Press seems always on (Upgrading from 2.3.6 to 2.6.3)
« Reply #1 on: July 26, 2013, 04:11:15 AM »
o_O works fine here...

juggernate

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 21
    • View Profile
Re: Sticky Press seems always on (Upgrading from 2.3.6 to 2.6.3)
« Reply #2 on: July 26, 2013, 07:22:04 AM »
Dang. I'm not sure what to try. It doesn't work on my Mac 10.8.4 if I upgrade NGUI on either Unity 3.5.7 or 4.2.

I am calling this on a gameObject with just a Mesh Renderer, Trigger Collider but no other NGUI components. Am I now supposed to have some NGUI component attached?

This is essentially how I'm using OnPress and it was working fine before, am I doing something wrong? Even with sticky OFF I get the Debug message when I let go outside of the object, instead of when the cursor leaves the collision area like it did in 2.3.6

  1. void OnPress (bool isDown) {
  2.                 Debug.Log ("Pressing: " + gameObject.name);
  3.                 if (isDown){
  4.                         toggleKey();
  5.                 }
  6.         }

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Sticky Press seems always on (Upgrading from 2.3.6 to 2.6.3)
« Reply #3 on: July 27, 2013, 12:42:01 PM »
Open up UICamera.cs, go to around line 1103 (lines may differ from the version I have), and comment out this:
  1. if (currentTouch.clickNotification != ClickNotification.None)
That line is right above this comment:
  1. // If the user is pressing down and has dragged the touch away from the original object,
  2. // unpress the original object and notify the new object that it is now being pressed on.

juggernate

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 21
    • View Profile
Re: Sticky Press seems always on (Upgrading from 2.3.6 to 2.6.3)
« Reply #4 on: July 27, 2013, 05:15:53 PM »
That did it. Thanks!  :) Also, I should mention my build target is iOS. I just learned that non-sticky would work on the device, but not in the editor. But now with commenting out that line it works in both. Thanks