Here's a simple reference image for standard Unity input mappings. I've included both button numbers and axis mappings.
Note that this doesn't use the ODK - you'll need to comment out the events in OuyaUnityApplication.java for this to work.
This is mainly for testing purposes to get set up with input quickly, especially if you are using other input frameworks that rely on Unity's native input. Eventually you'll want to migrate everything to using the ODK, especially once the initial issues are sorted out.
EDIT: Buttons 2 and 3 were initially incorrect. The below image has been updated to reflect this.
So by "comment out the events in OuyaUnityApplication.java" you mean the "onKeyDown" and "onGenericMotionEvent" functions, right? And when you say the buttons are 0,1,2,3, that means KeyCode.Joystick1Button0, KeyCode.Joystick1Button1, KeyCode.Joystick1Button2, KeyCode.Joystick1Button3? (or Joystick2 for second player, etc...)
'Cause I can't get my controls working at all on hardware using the standard Unity input classes with these values. Plus the face buttons still seem to be controlling the OUYA dashboard.
@Dreamwriter: Correct - you likely have to change the java class to extend from UnityPlayerActivity instead of Activity, as well.
Again another disclaimer: keep in mind that this is meant for quick setup and requires basically stripping the ODK of all input functions. The next update to the ODK as posted above will do this automatically, setting up input both in the IDE and on the hardware through the same API.
Out of curiosity, will this update be available before the competition is over? I'm an animator, and programming is something I've been teaching myself over the years, so it's very hard for me to set up the entire package. I am extremely nervous of ending up with an .apk that is useless.
We have the input ready for packing, I just need to disable IAP before I post it. Could have the update tonight... I'll run the playmaker idea past Marco. Maybe playmaker has a runtime that I can distribute with the examples?
This seems quite useful. Is it possible to build the APK as standard Android game (without including the ODK), provided that only these controller mappings will be used? Would such APK work on OUYA?
Comments
OUYA Inc | Android Developer
Skype: tgraupmann_prey
http://github.com/ouya/docs
http://github.com/ouya/ouya-sdk-examples
Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]
Use caution when setting [persistent wireless mode].
So by "comment out the events in OuyaUnityApplication.java" you mean the "onKeyDown" and "onGenericMotionEvent" functions, right? And when you say the buttons are 0,1,2,3, that means KeyCode.Joystick1Button0, KeyCode.Joystick1Button1, KeyCode.Joystick1Button2, KeyCode.Joystick1Button3? (or Joystick2 for second player, etc...)
'Cause I can't get my controls working at all on hardware using the standard Unity input classes with these values. Plus the face buttons still seem to be controlling the OUYA dashboard.
OUYA Inc | Android Developer
Skype: tgraupmann_prey
http://github.com/ouya/docs
http://github.com/ouya/ouya-sdk-examples
Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]
Use caution when setting [persistent wireless mode].
OUYA Inc | Android Developer
Skype: tgraupmann_prey
http://github.com/ouya/docs
http://github.com/ouya/ouya-sdk-examples
Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]
Use caution when setting [persistent wireless mode].
OUYA Inc | Android Developer
Skype: tgraupmann_prey
http://github.com/ouya/docs
http://github.com/ouya/ouya-sdk-examples
Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]
Use caution when setting [persistent wireless mode].
OUYA Inc | Android Developer
Skype: tgraupmann_prey
http://github.com/ouya/docs
http://github.com/ouya/ouya-sdk-examples
Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]
Use caution when setting [persistent wireless mode].