Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 4th, 2013  |  syntax: C#  |  size: 1.34 KB  |  views: 47  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class OuyaControllerExample2 : MonoBehaviour
  6. {
  7.     ///
  8.     /// This is your assigned developer id
  9.     ///
  10.     private const string DEVELOPER_ID = "310a8f51-4d6e-4ae5-bda0-b93878e5f5d0";
  11.  
  12.     void Awake()
  13.     {
  14.         try
  15.         {
  16.             OuyaSDK.initialize(DEVELOPER_ID);
  17.  
  18.             OuyaSDK.registerInputButtonListener(new OuyaSDK.InputButtonListener<OuyaSDK.InputButtonEvent>()
  19.             {
  20.                 onSuccess = (OuyaSDK.InputButtonEvent inputEvent) =>
  21.                 {
  22.                     OuyaInputManager.HandleButtonEvent(inputEvent);
  23.                 },
  24.  
  25.                 onFailure = (int errorCode, string errorMessage) =>
  26.                 {
  27.                 }
  28.             });
  29.  
  30.             OuyaSDK.registerInputAxisListener(new OuyaSDK.InputAxisListener<OuyaSDK.InputAxisEvent>()
  31.             {
  32.                 onSuccess = (OuyaSDK.InputAxisEvent inputEvent) =>
  33.                 {
  34.                     OuyaInputManager.HandleAxisEvent(inputEvent);
  35.                 },
  36.  
  37.                 onFailure = (int errorCode, string errorMessage) =>
  38.                 {
  39.                 }
  40.             });
  41.         }
  42.         catch (System.Exception ex)
  43.         {
  44.             Debug.LogError(string.Format("Awake exception={0}", ex));
  45.         }
  46.     }
  47. }
clone this paste RAW Paste Data