Author Topic: ScrollView Bug Report  (Read 6224 times)

jeoh

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
ScrollView Bug Report
« on: April 12, 2015, 09:47:03 PM »
Hello I'm developing smart phone game.
So, I only use touch event for event source of camera.
Using only touch event source doesn't allows drag events in Unity Editor.
I think this is some kind of bug.
If I set mouse event true and set false again, then drag events work.

Please, mail me about this bug.

I'm using NGUI 3.8.2 version

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ScrollView Bug Report
« Reply #1 on: April 16, 2015, 05:09:48 AM »
UIDragScrollView script uses drag events to move the scroll view. Are you saying it doesn't work for you?

jeoh

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: ScrollView Bug Report
« Reply #2 on: April 18, 2015, 02:34:18 AM »
Yes it doesn't work.

using below setting,
UICamera setting -> event source: touch

Click event occur in editor, But not dragging

jeoh

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: ScrollView Bug Report
« Reply #3 on: April 18, 2015, 02:37:06 AM »
Just open your scrollview example scene and disable mouse event source on camera.
Then you can see what i'm saying

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ScrollView Bug Report
« Reply #4 on: April 18, 2015, 01:10:59 PM »
Got it, thanks. Open up UICamera's ProcessFakeTouches function and set the currentScheme on line 1620:
  1.         void ProcessFakeTouches ()
  2.         {
  3.                 bool pressed = Input.GetMouseButtonDown(0);
  4.                 bool unpressed = Input.GetMouseButtonUp(0);
  5.                 bool held = Input.GetMouseButton(0);
  6.  
  7.                 if (pressed || unpressed || held)
  8.                 {
  9.                         currentScheme = ControlScheme.Touch; // <-- here
  10.                         currentTouchID = 1;
  11.                         currentTouch = mMouse[0];
  12.                         currentTouch.touchBegan = pressed;
  13. ...