Support => NGUI 3 Support => Topic started by: ZachHoefler on January 29, 2013, 06:47:53 AM
Title: OUYA Button Support via new UIButtonKeys
Post by: ZachHoefler on January 29, 2013, 06:47:53 AM
There've been a few posts here and there about people developing for the OUYA. As-is, NGUI's built-in UIButtonKeys will not work on the console itself because the OUYA SDK's input doesn't go through Unity's input. So, with that in mind, I re-wrote the UIButtonKeys class to work on the dev console.
Get it here! OuyaUIButtonKeys.cs (http://pastebin.com/B32435Z0)
Note: You will also need to change UICamera.cs. (For an explanation, see this thread (http://www.tasharen.com/forum/index.php?topic=2088.0)) Under UICamera.Awake(), it checks the current platform, and will disable some input options, which will mess up button selection. You can just comment out the Android check, like so, and it will work:
It could potentially be cleaner to do all of the input changes in UICamera.cs itself; however, keeping the input handling entirely in a separate script will make it a lot easier to merge in new versions.
Title: Re: OUYA Button Support via new UIButtonKeys
Post by: ArenMook on January 29, 2013, 05:50:11 PM
UICamera has "onCustomInput" delegate you can tie into for your OUYA event processing.
I'll remove the force-setting of keyboard and controller settings for Android as well, so you won't need to modify UICamera.
Title: Re: OUYA Button Support via new UIButtonKeys
Post by: maaya on September 16, 2014, 06:57:57 PM
Not sure if any changes were made to handle this, but I had to comment out the Android override for the mouse handler to get the Ouya Touchpad working. This is because the ProcessMouse() happens prior to the onCustomInput call.