Author Topic: Not Using Scroll Wheel Fix  (Read 3177 times)

deram_scholzara

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Not Using Scroll Wheel Fix
« on: December 15, 2013, 12:11:22 AM »
I don't have an axis set up for the mouse scroll wheel because I don't use it in my game.  NGUI, however, currently expects that if you're using the mouse, you must be using the scroll wheel.  To get around this, I changed this part of UICamera.cs:
  1.                         float scroll = Input.GetAxis(scrollAxisName);
  2.                         if (scroll != 0f) Notify(mHover, "OnScroll", scroll);
to this:
  1.                         if (!string.IsNullOrEmpty(scrollAxisName)) {
  2.                                 float scroll = Input.GetAxis(scrollAxisName);
  3.                                 if (scroll != 0f) Notify(mHover, "OnScroll", scroll);
  4.                         }

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Not Using Scroll Wheel Fix
« Reply #1 on: December 15, 2013, 08:11:46 AM »
That makes sense. I'll mirror the change on my end.