Can I use OuyaSDK key codes with native Unity Input?

Hi Tim,

I'm just starting my game from scratch, and following your examples on the Ouya website, at first I set my input handling code up like this:

private void HandleButtonEvent(OuyaSDK.OuyaPlayer p, OuyaSDK.KeyEnum b, OuyaSDK.InputAction bs)

{


if (b.Equals(OuyaSDK.KeyEnum.BUTTON_O) && bs.Equals(OuyaSDK.InputAction.KeyDown))

{

//Do something

}

}


...but then after reading here in the forums, I decided to switch to native Unity input handling before going any further. So in my Update() I put:

if(Input.GetKeyDown(OuyaSDK.KeyEnum.BUTTON_O))

{

//Do something

}


And that doesn't work. Unity says "Argument `#1' cannot convert `int' expression to type `string'".

Should I be using your provided key codes when using native Unity input, and if so, how do you recommend I do that? Sorry if this has been answered somewhere else. I know there are a lot of questions about this here on the forums, but I couldn't find a post that clarified this.

Best Answer

Answers

Sign In or Register to comment.