void Awake() { OuyaSDK.registerMenuButtonUpListener(this); OuyaSDK.registerMenuAppearingListener(this); OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); }
void Awake() { OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); OuyaInputManager.OuyaButtonEvent.addButtonEventListener(HandleButtonEvent); }
void Awake() { OuyaSDK.registerJoystickCalibrationListener(this); OuyaSDK.registerMenuButtonUpListener(this); OuyaSDK.registerMenuAppearingListener(this); OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); }
void Awake() { OuyaSDK.registerMenuAppearingListener(this); OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); //Register method listener to handle button events. OuyaInputManager.OuyaButtonEvent.addButtonEventListener(HandleButtonEvent); }
void Awake() { OuyaSDK.registerMenuAppearingListener(this); OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); OuyaSDK.registerGetProductsListener(this); OuyaSDK.registerPurchaseListener(this); OuyaSDK.registerGetReceiptsListener(this); }
void Awake() { OuyaSDK.registerMenuAppearingListener(this); OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); OuyaSDK.registerRequestGamerInfoListener(this); OuyaSDK.registerRequestProductsListener(this); OuyaSDK.registerRequestPurchaseListener(this); OuyaSDK.registerRequestReceiptsListener(this); }
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.registerPauseListener(this); OuyaSDK.registerResumeListener(this); OuyaSDK.registerFetchGamerInfoListener(this); OuyaSDK.registerGetProductsListener(this); OuyaSDK.registerPurchaseListener(this); OuyaSDK.registerGetReceiptsListener(this); Input.ResetInputAxes(); }
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.registerJoystickCalibrationListener(this); OuyaSDK.registerMenuAppearingListener(this); OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); m_backgroundBlack = new Texture2D(1, 1); m_backgroundBlack.SetPixel(0, 0, Color.black); m_backgroundBlack.Apply(); m_guiSkin = ScriptableObject.CreateInstance <GUISkin>(); m_guiSkin.label.normal.textColor = Color.white; m_guiSkin.label.normal.background = m_backgroundBlack; int[] buttons = { OuyaController.BUTTON_O, OuyaController.BUTTON_U, OuyaController.BUTTON_Y, OuyaController.BUTTON_A, OuyaController.BUTTON_L1, OuyaController.BUTTON_L3, OuyaController.BUTTON_R1, OuyaController.BUTTON_R3, OuyaController.BUTTON_DPAD_DOWN, OuyaController.BUTTON_DPAD_LEFT, OuyaController.BUTTON_DPAD_RIGHT, OuyaController.BUTTON_DPAD_UP, OuyaController.BUTTON_MENU, }; StringBuilder sb = new StringBuilder(); foreach (int button in buttons) { Setup(button); string label; SetLabel(out label, button); if (!string.IsNullOrEmpty(label)) { sb.Append(label); sb.Append(" "); } m_label = "Hello from Unity: " + sb.ToString(); } }
/// <summary> /// Initializes this instance. /// </summary> protected override void Awake() { base.Awake(); if (_primaryFader == null) { _primaryFader = new AudioFader(); } else { _primaryFader.Set0(); } if (_secondaryFader == null) { _secondaryFader = new AudioFader(); } else { _secondaryFader.Set0(); } if (_audioSource1 == null) { _audioSource1 = audio; } else { if (_audioSource2 && _audioSource1 != audio) // make sure that by default the primary audio source is _audioSource1 { SwitchAudioSources(); } } _Set0(); _audioController = AudioController.Instance; //Debug.Log( "AudioObject.Awake" ); #if OUYA_PAUSE_SYSTEM OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); #endif }
private void Awake() { m_activity = new OuyaUnityActivity(UnityPlayer.currentActivity); #if PERFORMANCE_TEST_MEASURE_LATENCY ThreadStart ts = new ThreadStart(TestWorker); Thread thread = new Thread(ts); thread.Start(); #endif OuyaSDK.registerJoystickCalibrationListener(this); OuyaSDK.registerMenuAppearingListener(this); OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); m_backgroundBlack = new Texture2D(1, 1); m_backgroundBlack.SetPixel(0, 0, Color.black); m_backgroundBlack.Apply(); m_guiSkin = ScriptableObject.CreateInstance <GUISkin>(); m_guiSkin.label.normal.textColor = Color.white; m_guiSkin.label.normal.background = m_backgroundBlack; StringBuilder sb = new StringBuilder(); foreach (int button in Buttons) { Setup(button); string label; SetLabel(out label, button); if (!string.IsNullOrEmpty(label)) { sb.Append(label); sb.Append(" "); } m_label = "Hello from Unity: " + sb.ToString(); } }
private void Awake() { OuyaSDK.registerContentInitializedListener(this); OuyaSDK.registerContentDeleteListener(this); OuyaSDK.registerContentDownloadListener(this); OuyaSDK.registerContentInstalledSearchListener(this); OuyaSDK.registerContentPublishedSearchListener(this); OuyaSDK.registerContentPublishListener(this); OuyaSDK.registerContentSaveListener(this); OuyaSDK.registerContentUnpublishListener(this); OuyaSDK.registerResumeListener(this); if (null != m_textureScreenshots) { m_bitmapScreenshots = new Bitmap[m_textureScreenshots.Length]; for (int index = 0; index < m_textureScreenshots.Length; ++index) { Texture2D texture = m_textureScreenshots[index]; Debug.Log("Encoding PNG from texture bytes"); // make texture readable byte[] buffer = texture.EncodeToPNG(); if (null == buffer || buffer.Length == 0) { Debug.LogError("Failed to encode png"); } else { Debug.Log("Converting bytes to bitmap"); m_bitmapScreenshots[index] = BitmapFactory.decodeByteArray(buffer, 0, buffer.Length); } } } ResetFocus(); }
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 }
void Awake() { OuyaSDK.registerPauseListener(this); OuyaSDK.registerResumeListener(this); }