Ouya input from JS?

RaielRaiel Posts: 26Member
I was tooling along happily, and just realized that all of the Ouya input handler examples are in C#. And here's me having written all of my stuff in JS!

Worst case, I'm now looking at trying to bundle together a struct with which to Send Message the data from the OuyaInputManager over to my JS input collating script, but that's just so... meh. Has anyone else had any luck piping input from the CS side over to JS?

Comments

  • kerzkerkerzker Posts: 1Member
    I've gone and done the same :( No luck anything so far
  • tommosaurtommosaur Posts: 3Member
    edited January 2013
    My first post on the forums =)
    Anyway, yeah, you can access C# stuff in JS stuff and the other way round in unity.
    To be able to do that directly (without using SendMessage etc messaging) you have to make the scripts be compiled in right order.
    You can change the compilation order by putting scripts in certain folders since Unity compiles the content of some special folders in certain order.
    You could put your JS class/ script file into the Plugins folder for example to have it be compiled before the C# script from which you want to send stuff to the JS side.
    Here's more information on that topic:
    Post edited by tommosaur on
  • SantaRagioneSantaRagione Posts: 7Member
    I use import OuyaInputManager at the top of my JS script.

    using the OUYA unitypackage make sure that these are in your "Plugins" folder:
    LitJson FOLDER
    OuyaGameObject.cs
    OuyaInputManager.cs
    OuyaNGUIHandler.cs
    OuyaSDK.cs
    UILabel.cs
  • MURAinteractiveMURAinteractive Posts: 73Member
    Looks like I am going to need to do the same. :( That's going to be a project.
  • RaielRaiel Posts: 26Member
    edited January 2013
    Well, I've ended up just dragging the all three of the Ouya SDK installed directories under plugins, and things seem to work ok for now, including the Ouya SDK's panels and such editor additions. This makes me rather uncomfortable, as now I'll have to fiddle with it every time I update the SDK.

    I'm really not sure how to determine if things are working either; I can build the OSX version just fine, and I can build an APK just fine that I can run in the emulator. Unfortunately I don't have an Android device with a controller input, and I'm only a regular Ouya backer, so I won't see a kit for a while.

    Hopefully everything is working just fine for the Create gamejam!


    Post edited by Raiel on
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    If it wasn't setup properly you would be seeing a DEX error, even on another android device.
    ~Tim Graupmann
    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].
  • kiwicocokiwicoco Posts: 86Member
    I can confirm that this is working for me too. Thank you so much!!! =D
    I use import OuyaInputManager at the top of my JS script.

    using the OUYA unitypackage make sure that these are in your "Plugins" folder:
    LitJson FOLDER
    OuyaGameObject.cs
    OuyaInputManager.cs
    OuyaNGUIHandler.cs
    OuyaSDK.cs
    UILabel.cs

  • MidoBasimMidoBasim Posts: 45Member
    kiwicoco said:
    I can confirm that this is working for me too. Thank you so much!!! =D
    I use import OuyaInputManager at the top of my JS script.

    using the OUYA unitypackage make sure that these are in your "Plugins" folder:
    LitJson FOLDER
    OuyaGameObject.cs
    OuyaInputManager.cs
    OuyaNGUIHandler.cs
    OuyaSDK.cs
    UILabel.cs

    I can also confirm that this works. 
    Thanks a lot!!
  • LipekSamoZloLipekSamoZlo Posts: 7Member
    When I copied 
    I use import OuyaInputManager at the top of my JS script.

    using the OUYA unitypackage make sure that these are in your "Plugins" folder:
    LitJson FOLDER
    OuyaGameObject.cs
    OuyaInputManager.cs
    OuyaNGUIHandler.cs
    OuyaSDK.cs
    UILabel.cs
    When I copied this things to Plugins I have few errors:
    Assets/Plugins/OuyaInputManager.cs(566,81): error CS0246: The type or namespace name `JoystickType' could not be found. Are you missing a using directive or an assembly reference?
    and other with 'AxisTypes' and 'AnalogTypes'
    Is anyone can help me with this issue ?
  • ivansilveiraivansilveira Posts: 4Member
    When I copied 
    I use import OuyaInputManager at the top of my JS script.

    using the OUYA unitypackage make sure that these are in your "Plugins" folder:
    LitJson FOLDER
    OuyaGameObject.cs
    OuyaInputManager.cs
    OuyaNGUIHandler.cs
    OuyaSDK.cs
    UILabel.cs
    When I copied this things to Plugins I have few errors:
    Assets/Plugins/OuyaInputManager.cs(566,81): error CS0246: The type or namespace name `JoystickType' could not be found. Are you missing a using directive or an assembly reference?
    and other with 'AxisTypes' and 'AnalogTypes'
    Is anyone can help me with this issue ?
    To be completely sure, I moved every "Ouya" script to the plugin folder. No errors here, although, I can't test it.
Sign In or Register to comment.