static public GameObject FindChild(GameObject obj, string name) { GameObject go = FindChildNoWarning(obj, name); if (go == null) { OVRDebugUtils.Print("child " + name + " was not found!"); } return(go); }
/// <summary> /// Outputs debug spam for any depressed button. /// This is only used for finding which buttons are which with new controllers. /// </summary> private static void ShowButtonValues() { for (int i = 0; i < 6; ++i) { string buttonName = "Test Button " + i; if (Input.GetButton(buttonName)) { OVRDebugUtils.Print("Test Button " + i + " is down."); } } }
/// <summary> /// Outputs debug spam for any non-zero axis. /// This is only used for finding which axes are which with new controllers. /// </summary> private static void ShowAxisValues() { for (int i = 1; i <= 20; ++i) { string axisName = "Test Axis " + i; float v = Input.GetAxis(axisName); if (Mathf.Abs(v) > 0.2f) { OVRDebugUtils.Print("Test Axis " + i + ": v = " + v); } } }
/// <summary> /// Static contructor for the OVRInputControl class. /// </summary> static OVRInputControl() { #if UNITY_ANDROID && !UNITY_EDITOR OVRGamepadController.SetReadAxisDelegate(ReadJoystickAxis); OVRGamepadController.SetReadButtonDelegate(ReadJoystickButton); #endif switch (Application.platform) { case RuntimePlatform.WindowsPlayer: Init_Windows(); break; case RuntimePlatform.WindowsEditor: Init_Windows_Editor(); break; case RuntimePlatform.Android: Init_Android(); break; case RuntimePlatform.OSXPlayer: Init_OSX(); break; case RuntimePlatform.OSXEditor: Init_OSX_Editor(); break; case RuntimePlatform.IPhonePlayer: Init_iPhone(); break; } string[] joystickNames = Input.GetJoystickNames(); for (int i = 0; i < joystickNames.Length; ++i) { OVRDebugUtils.Print("Found joystick '" + joystickNames[i] + "'..."); } }
/// <summary> /// Initializes the input system for iPhone. /// </summary> private static void Init_iPhone() { OVRDebugUtils.Print("Initializing input for iPhone."); allowKeyControls = false; platformPrefix = "iPhone:"; }
/// <summary> /// Initializes the input system for OSX when running from the Unity editor. /// </summary> private static void Init_OSX_Editor() { OVRDebugUtils.Print("Initializing input for OSX Editor."); allowKeyControls = true; platformPrefix = "OSX:"; }
/// <summary> /// Initializes the input system for OSX. /// </summary> private static void Init_OSX() { OVRDebugUtils.Print("Initializing input for OSX."); allowKeyControls = false; platformPrefix = "OSX:"; }
/// <summary> /// Initializes the input system for Android. /// </summary> private static void Init_Android() { OVRDebugUtils.Print("Initializing input for Android."); allowKeyControls = true; platformPrefix = "Android:"; }
/// <summary> /// Initializes the input system for Windows when running from the Unity editor. /// </summary> private static void Init_Windows_Editor() { OVRDebugUtils.Print("Initializing input for Windows Editor."); allowKeyControls = true; platformPrefix = "Win:"; }
/// <summary> /// Initializes the input system for OSX. /// </summary> private static void Init_Windows() { OVRDebugUtils.Print("Initializing input for Windows."); allowKeyControls = false; platformPrefix = "Win:"; }