Author Topic: Can't figure out how to make Rewired Input system work with NGUI 3  (Read 11811 times)

stickerb

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 1
    • View Profile
    • Boidae Games
Hi, I'm currently working on a PC port of a game I made a few months ago and I'm having trouble on getting NGUI working with Rewired. Rewired replaces unity's Input system and I can't find the scripts of NGUI that take input and even if I do, I really don't know what lines should I modify (have been trying to find something similar to input axes and getButtonDown)
Any kind of help would be kindly appreciated. I'm using both latest versions of NGUI and Rewired on Unity 4.6.4f1.
Thanks in advance, cheers

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Can't figure out how to make Rewired Input system work with NGUI 3
« Reply #1 on: June 11, 2015, 06:11:20 AM »
Simply set UICamera.GetKey, UICamera.GetKeyDown, etc. I do that to get InControl working in Windward.

nicron2001

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: Can't figure out how to make Rewired Input system work with NGUI 3
« Reply #2 on: July 28, 2015, 04:35:36 AM »
A little more help on this would be greatly appreciated. Since I switched to Rewired for many reasons, I am not able to get NGUI accept the player actions instead of key presses.  At the same time, NGUI will not deactivate controllers that are not properly calibrated and that causes all kinds of problems since it takes the RawInput of Unity instead of Rewired's DirectInput-based actions.

It would be great if you could point me into the right direction in a little more detail.

Ben

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile

nicron2001

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: Can't figure out how to make Rewired Input system work with NGUI 3
« Reply #4 on: August 03, 2015, 12:55:43 AM »
Thank you, that was very helpful.

The only problem I have now is that the Joystick doesn't move the thumbs of my UISliders any more, which means that for example volume can't be changed using the joystick right now. Any ideas on a possible solution.

Kind regards
Ben

nicron2001

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: Can't figure out how to make Rewired Input system work with NGUI 3
« Reply #5 on: August 05, 2015, 02:47:27 AM »
Testing shows that the problem is actually not related to using Rewired, but sliders simply don't react to my Pan Axis at all. The axis are set up properly for the camera and get values from the right sticks of the xbox360-controller. Even though the slider is highlighted, it doesn't change its value accordingly.

Any ideas on possible reasons for that behavior?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Can't figure out how to make Rewired Input system work with NGUI 3
« Reply #6 on: August 05, 2015, 09:04:22 AM »
Panning is done via UIDragScrollView. You should have one of the items within your scroll view selected (and they should have UIDragScrollView on them). Forget the scroll bars.

nicron2001

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: Can't figure out how to make Rewired Input system work with NGUI 3
« Reply #7 on: August 06, 2015, 05:54:38 AM »
I don't want to pan the view, but change a volume slider via controller. This used to work using the vertical or horizontal axes, but according to 3.9.0 changelog, this is now done via the Pan axes of the controller as defined in the UICamera.

- NEW: Sliders can now be adjusted via controller by using Pan axes.

So my question is: how can I make the UISlider change via controller input?

Thanks in advance.

nicron2001

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: Can't figure out how to make Rewired Input system work with NGUI 3
« Reply #8 on: August 06, 2015, 06:48:36 AM »
Seems to have been related to constrains in the key navigation component - problem solved.