
Untitled
By: a guest on
Jan 4th, 2013 | syntax:
C# | size: 1.34 KB | views:
47 | expires: Never
using System;
using System.Collections.Generic;
using UnityEngine;
public class OuyaControllerExample2 : MonoBehaviour
{
///
/// This is your assigned developer id
///
private const string DEVELOPER_ID = "310a8f51-4d6e-4ae5-bda0-b93878e5f5d0";
void Awake()
{
try
{
OuyaSDK.initialize(DEVELOPER_ID);
OuyaSDK.registerInputButtonListener(new OuyaSDK.InputButtonListener<OuyaSDK.InputButtonEvent>()
{
onSuccess = (OuyaSDK.InputButtonEvent inputEvent) =>
{
OuyaInputManager.HandleButtonEvent(inputEvent);
},
onFailure = (int errorCode, string errorMessage) =>
{
}
});
OuyaSDK.registerInputAxisListener(new OuyaSDK.InputAxisListener<OuyaSDK.InputAxisEvent>()
{
onSuccess = (OuyaSDK.InputAxisEvent inputEvent) =>
{
OuyaInputManager.HandleAxisEvent(inputEvent);
},
onFailure = (int errorCode, string errorMessage) =>
{
}
});
}
catch (System.Exception ex)
{
Debug.LogError(string.Format("Awake exception={0}", ex));
}
}
}