void Awake() { OuyaSDK.registerMenuButtonUpListener(this); OuyaSDK.registerMenuAppearingListener(this); OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); }
void Awake() { OuyaSDK.registerJoystickCalibrationListener(this); OuyaSDK.registerMenuButtonUpListener(this); OuyaSDK.registerMenuAppearingListener(this); OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); }
void Awake() { OuyaSDK.registerMenuButtonUpListener(this); OuyaSDK.registerMenuAppearingListener(this); OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); //Register method listener to handle button events. OuyaInputManager.OuyaButtonEvent.addButtonEventListener(HandleButtonEvent); }
void Awake() { OuyaSDK.registerMenuButtonUpListener(this); OuyaSDK.registerMenuAppearingListener(this); OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); OuyaSDK.registerFetchGamerUUIDListener(this); OuyaSDK.registerGetProductsListener(this); OuyaSDK.registerPurchaseListener(this); OuyaSDK.registerGetReceiptsListener(this); }
void Awake() { OuyaSDK.registerMenuButtonUpListener(this); OuyaSDK.registerMenuAppearingListener(this); OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); OuyaSDK.registerGetProductsListener(this); OuyaSDK.registerPurchaseListener(this); OuyaSDK.registerGetReceiptsListener(this); loader = this.GetComponent <loadingScript>(); }
void Awake() { OuyaSDK.registerMenuButtonUpListener(this); OuyaSDK.registerMenuAppearingListener(this); OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); Input.ResetInputAxes(); //import old player prefs toggles[0] = PlayerPrefs.GetInt("music", 1); toggles[1] = PlayerPrefs.GetInt("hellmode", 0); toggles [2] = PlayerPrefs.GetInt("doublepipesets", 1); //default double pipes to on }
void Awake() { OuyaSDK.registerMenuButtonUpListener(this); OuyaSDK.registerMenuAppearingListener(this); OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); OuyaInputManager.OuyaButtonEvent.addButtonEventListener(HandleButtonEvent); //Get our character controller; controller = GetComponent <CharacterController>(); #if UNITY_EDITOR //If you find that your controller does not work properly in the Unity Editor, You can add a custom controller mapping as seen below. /* Here is some code to find keycodes for devices that are mapped to your InputManager.asset * List<OuyaGameObject.Device> devices = OuyaInputManager.GetDevices(); * for (int iPlayerJoystick = 1; iPlayerJoystick <= devices.Count; iPlayerJoystick++) * { * OuyaGameObject.Device device = devices.Find(delegate(OuyaGameObject.Device d) { return (null == d || null == devices) ? false : (d.id == devices[iPlayerJoystick - 1].id); }); * for (int i = 0; i < 13; i++) * { * //Controller Name: * string fireBtnName = string.Format("Joystick{0}Button{1}", iPlayerJoystick, i); * KeyCode keycode = (KeyCode)System.Enum.Parse(typeof(KeyCode), fireBtnName); * Debug.Log(string.Format("Button Name:{0}, Keycode:{1}",keycode,int(keycode)); * } * } */ //Custom Controller Mapping. List <ButtonMap> buttonMap = new List <ButtonMap>(); ControllerType xbox360 = new ControllerType(); xbox360.name = "xbox360"; xbox360.leftAnalogH = 1; xbox360.leftAnalogV = 2; xbox360.rightAnalogH = 4; xbox360.rightAnalogV = 5; xbox360.triggers = 3; xbox360.dpadH = 6; xbox360.dpadV = 7; JoystickType joystickType = JoystickType.xbox; //Start XBOX 360 ButtonMap ( only has 13 buttons ) buttonMap.Add(new ButtonMap(joystickType, 370, OuyaSDK.KeyEnum.BUTTON_O)); buttonMap.Add(new ButtonMap(joystickType, 371, OuyaSDK.KeyEnum.BUTTON_A)); buttonMap.Add(new ButtonMap(joystickType, 372, OuyaSDK.KeyEnum.BUTTON_U)); buttonMap.Add(new ButtonMap(joystickType, 373, OuyaSDK.KeyEnum.BUTTON_Y)); buttonMap.Add(new ButtonMap(joystickType, 374, OuyaSDK.KeyEnum.BUTTON_LB)); buttonMap.Add(new ButtonMap(joystickType, 375, OuyaSDK.KeyEnum.BUTTON_RB)); buttonMap.Add(new ButtonMap(joystickType, 376, OuyaSDK.KeyEnum.BUTTON_SELECT)); buttonMap.Add(new ButtonMap(joystickType, 377, OuyaSDK.KeyEnum.BUTTON_START)); buttonMap.Add(new ButtonMap(joystickType, 378, OuyaSDK.KeyEnum.BUTTON_L3)); buttonMap.Add(new ButtonMap(joystickType, 379, OuyaSDK.KeyEnum.BUTTON_R3)); buttonMap.Add(new ButtonMap(joystickType, 380, OuyaSDK.KeyEnum.BUTTON_LT)); //Doesn't Show up buttonMap.Add(new ButtonMap(joystickType, 381, OuyaSDK.KeyEnum.BUTTON_RT)); //Doesn't Show up buttonMap.Add(new ButtonMap(joystickType, 382, OuyaSDK.KeyEnum.BUTTON_SYSTEM)); //Dowsn't Show up /* * //4 button dpad mappings * buttonMap.Add(new ButtonMap(joystickType, 13, OuyaSDK.KeyEnum.BUTTON_DPAD_LEFT)); * buttonMap.Add(new ButtonMap(joystickType, 14, OuyaSDK.KeyEnum.BUTTON_DPAD_RIGHT)); * buttonMap.Add(new ButtonMap(joystickType, 15, OuyaSDK.KeyEnum.BUTTON_DPAD_UP)); * buttonMap.Add(new ButtonMap(joystickType, 16, OuyaSDK.KeyEnum.BUTTON_DPAD_DOWN)); */ //controllers.Add(xbox360.name,xbox360) //OuyaControllerMapping.RegisterCustomControllerMapping(xbox360, buttonMap); //duplicate of existing #endif }