Step 2: Bring your files to the project ( including your NGUI version )
Step 3: Import the Plugin and Uncheck the NGUI folder. If you deleted the NGUI examples in your project you may need to keep the NGUI Fantasy Atlas Assets.
Step 4: Complete configuration as per videos and other helpful tips on this forum.
That should get rid of your errors. I know it's a pain, I will work with Tim in future versions to clean up the NGUI stuff. Right now there is a reference to NGUI in the OuyaGameObject.cs OnGUI and that makes the dependancy.. if you remove that entire functions, then the plugin examples won't work, but your dependancy is gone from the atlas and you can safely remove the NGUI examples.
Hope that helps,
Marco
Marco Williams
Hashbang Games
Gravi is available on the OUYA look for it in the store!
Here's a step by step of mapping the 360 A button from the 'Setting up controller input for the IDE" video.
1. Plug in Xbox 360 Controller and notice it appears in the console log
2. Open the OuyaShowController.cs script
3. Move the #region Initialize Ouya line down into the try{} (About line 72)
4. Add an #if ANDROID line immediately after the #region Initialize Ouya line. Add the #endif line immediately before the #endregion line (About line 132)\
5. Add #region Handle Input for the IDE and then #endregion in the first two lines of the UpdateController() method
6. Add #if UNITY_EDITOR and then #endif inside #region Handle Input for the IDE that you just created
7. Inside the #if Unity_EDITOR that you just created add:
if(Input.GetButton("360_A_Button"))
{
Debug.Log ("360_A_Button");
m_keyEnum = OuyaSDK.KeyEnum.BUTTON_A;
m_inputAction = OuyaSDK.InputAction.KeyDown;
}
else
{
if(m_keyEnum == OuyaSDK.KeyEnum.BUTTON_A)
{
m_keyEnum = OuyaSDK.KeyEnum.NONE;
}
}
8. Edit > Project Settings > Input then expand Axes
9. Change size to 18
10. Expand the new Jump item and rename it "360_A_Button"
11. Change Descriptive Name to "Controller A Button"
12. Change Positive Button to "joystick button 0"
13. Run the game and press A. You should see the virtual A button turn green.
Edit: I had a typo so this wasn't working for me. The above should now work just fine. I'll do the steps for the trigger as well.
Yes the mappings should work on standalone, on android unity ide, on android, and on ouya.
I'll check on the LS and RS mappings. The buttons should be there, maybe just not used in the example. I need to add something to the xbox 360 controller model to show it was pressed. I guess it could go up and down.
On Windows at least, I had to shutdown Unity and replug the wired controllers, then relaunch Unity when weird things happen. Like two button down events for one button down.
[OT] @Randroid i don't think it works like that. USB has "a" or "b" plugs... im pretty sure some new tablets get around it with fancy firmware to become a "USB host" - it's my understanding that you can't do it with just any device
[/OT]
Can't find aapt.exe? Temp fix: Copy another one from 'android_sdk/build-tools/17.0.0' back to your 'platform-tools' -=Hicsy=- PM meFacebook
@Randroid The LS & RS ( aka L3 & R3 ) stick button press do work and are mapped in the 0.0.5.1 build. But I do not have them linked up in the OuyaShowController Example.
Marco Williams
Hashbang Games
Gravi is available on the OUYA look for it in the store!
I'm actually not getting the error on the input settings load. Nothing's happening. I switched projects to something else and back to the one I'm targeting Ouya. No luck. I shut Unity down entirely. No luck.
I'm using Unity 4.0.1f2 and targeting Android. Thanks for all of your hard work and efforts and thank you for any further help you can possibly provide.
I'm actually not getting the error on the input settings load. Nothing's happening. I switched projects to something else and back to the one I'm targeting Ouya. No luck. I shut Unity down entirely. No luck.
I'm using Unity 4.0.1f2 and targeting Android. Thanks for all of your hard work and efforts and thank you for any further help you can possibly provide.
To update: I started hacking around the OuyaMenuAdmin.cs file. I started looking at the path and felt like maybe the path wasn't quite right. I first tried Application.dataPath as a prefix to the InputManager.asset path. I took the "Assets\" off of the front of the string since Application.dataPath already has that. I then realized that the Application.dataPath value had slashes that were going opposite the way they were written in the MenuAdmin file. So I gave it a shot and switched them. Now it appears that I load the file, but nothing is really happening. Before I wasn't even getting into the fi.Exists conditional. Here's where I'm at. Thanks for any additional help.
Every now and then I'll get the error "You are trying to import an asset which contains a global game manager. This is not allowed." from the AssetDatabase.Refresh() line.
A little closer! I had to reverse the slash on the string dest on line 39 as well. I have all of the inputs, but now I need to figure out why my input is no longer reading in at all. At least before it was bizarre and some buttons were working :). It might be a Mac/PC difference of mapping? Anyone else using Mac here?
Cool. I'm at the point now where I have a wireless controller being detected in the application, but there are no button inputs coming in as far as I can tell (I'm logging Event.current). I wasn't able to get my wired 360 controller detected (despite the tattiebogle seeing it) and fortunately I bought a wireless xbox controller adapter the other day and it is at least acknowledging the controller.
What i've done is allowed you to put in custom controller types if your controller input is not being recognized in the IDE.
The code in the top of that is to help you detect what the codes are being reported from your controller.
The bottom part allows you to append a custom mapping for your controller.
Hopefully it will help you debug your controller. Also note: If your XBOX controller name that unity is reporting is NOT one of the following then send us the Controller Name so we can add it to the list of supported controllers.
case "XBOX 360 WIRELESS RECEIVER":
case "CONTROLLER (AFTERGLOW GAMEPAD FOR XBOX 360)":
case "CONTROLLER (XBOX 360 WIRELESS RECEIVER FOR WINDOWS)":
case "MICROSOFT X-BOX 360 PAD":
case "CONTROLLER (XBOX 360 FOR WINDOWS)":
case "XBOX 360 FOR WINDOWS (CONTROLLER)":
Unfortunately there is no easy way to support all the different controllers as we never know exactly which controllers names are reported in Unity. We've been adding them as we see or find them.
You can add your controller name to line: 444 of the OuyaInputManager and 370 of OuyaGameObject
Hope that helps!
--Marco
Marco Williams
Hashbang Games
Gravi is available on the OUYA look for it in the store!
I'm taking a look at this all now. I'll let you guys know if I have any further questions, but I think this is the missing link in my knowledge. Does/Can the Ouya controller ever work on your computer for testing?
My controller name being reported (down the left side of the Game Window) is "Microsoft Wireless 360 Controller".
Still trying to get back to being able to deploy. I actually had to change line 120 of OuyaMenuAdmin to:
It was not getting the Unity.app in the path as it needed to find the jar file. I've got to switch gears to actually making a game for a while, hehe, but thank you for the help guys!
Hmm.. I installed the latest and followed the instructions in the email. I have the most recent unity firmware and NOTHING..
I have tried all the scenes.. I can get the controller scene to respond- but it acts strange. I hit a button and the whole controller lights up green!.
Ack!
Anyone having the same problem(s)?
I have a day job and I am HOPING to be able to integrate Ouya controllers over the weekend, but this latest sdk is not working for me :(
Yep, same here. Might want to take a look at some of the tips Marco & Tim have been giving me. I'm getting much closer (note some of my findings as well). I don't have any more time to look into it today. I'll probably put 3-4 hours into tomorrow. Let us know what you find @brianbraatz
The users that are having trouble seem to be on Unity 4.X, and I'm not sure what the issue is? I had success importing to Unity 3.5.7 and then upgrading the project. Vs. importing directly into 4.X.
We'll check 4.0 sometime tonight or tomorrow and find the bugz. However, @burtonposey do you have the latest version of the Unity Package 0.0.5.1 if not make sure to PM tgraupmann and he will send it to you.
Marco Williams
Hashbang Games
Gravi is available on the OUYA look for it in the store!
We'll check 4.0 sometime tonight or tomorrow and find the bugz. However, @burtonposey do you have the latest version of the Unity Package 0.0.5.1 if not make sure to PM tgraupmann and he will send it to you.
I do have it. thanks for checking. There are a few lingering NGUI files in one of the packages that I missed (not the NGUI package itself). I have the full version, so it borked my NGUI for a few minutes. Just figured I would point it out. I was thinking I'd just avoid the NGUI package, but some NGUI files were in one of the two others.
I had same issue as Brian but noticed the window on the right that says what button ur presses is accurate so I'm ignoring the lights. With 0.0.5.1 and hash's new videos I was able to apply everything to skeleton character in unity 4.0
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].
Gravi is available on the OUYA look for it in the store!
Purchase our Gravi on Desura
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].
I'll check on the LS and RS mappings. The buttons should be there, maybe just not used in the example. I need to add something to the xbox 360 controller model to show it was pressed. I guess it could go up and down.
yep
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].
@Randroid i don't think it works like that. USB has "a" or "b" plugs... im pretty sure some new tablets get around it with fancy firmware to become a "USB host" - it's my understanding that you can't do it with just any device
-=Hicsy=-
PM me Facebook
Gravi is available on the OUYA look for it in the store!
Purchase our Gravi on Desura
Gravi is available on the OUYA look for it in the store!
Purchase our Gravi on Desura
In 4.X it logs an error when loading the input settings, but you can ignore the error.
After importing the package, reload the project and the input should be good to go.
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].
(line 49, OuyaMenuAdmin.cs)
#elif UNITY_4_0
string src = Application.dataPath + @"/Ouya/ProjectSettings/4.X/InputManager.asset";
FileInfo fi = new FileInfo(src);
if (fi.Exists) //it gets here in with my tweaks
{
fi.CopyTo(dest, true);
Debug.Log(string.Format("{0} Succesfully restored: {1}", DateTime.Now, dest));
AssetDatabase.Refresh();
}
#endif
Every now and then I'll get the error "You are trying to import an asset which contains a global game manager. This is not allowed." from the AssetDatabase.Refresh() line.
Thanks again.
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].
Gravi is available on the OUYA look for it in the store!
Purchase our Gravi on Desura
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].
Gravi is available on the OUYA look for it in the store!
Purchase our Gravi on Desura