void OnEnable() { if (logDebugInfo) { Debug.Log("InControl (version " + InputManager.Version + ")"); Logger.OnLogMessage += LogMessage; } InputManager.InvertYAxis = invertYAxis; InputManager.EnableXInput = enableXInput; InputManager.Setup(); foreach (var className in customProfiles) { var classType = Type.GetType(className); if (classType == null) { Debug.LogError("Cannot find class for custom profile: " + className); } else { var customProfileInstance = Activator.CreateInstance(classType) as UnityInputDeviceProfile; InputManager.AttachDevice(new UnityInputDevice(customProfileInstance)); } } if (dontDestroyOnLoad) { DontDestroyOnLoad(this); } }
void Start() { isPaused = false; Time.timeScale = 1.0f; Logger.OnLogMessage += logMessage => logMessages.Add(logMessage); // InputManager.HideDevicesWithProfile( typeof( Xbox360MacProfile ) ); // InputManager.InvertYAxis = true; // InputManager.EnableXInput = true; InputManager.Setup(); InputManager.OnDeviceAttached += inputDevice => Debug.Log("Attached: " + inputDevice.Name); InputManager.OnDeviceDetached += inputDevice => Debug.Log("Detached: " + inputDevice.Name); InputManager.OnActiveDeviceChanged += inputDevice => Debug.Log("Active device changed to: " + inputDevice.Name); TestInputMappings(); Debug.Log("InControl (version " + InputManager.Version + ")"); }
void OnEnable() { InputManager.Setup(); foreach (var className in customProfiles) { var classType = Type.GetType(className); if (classType == null) { Debug.LogError("Cannot find class for custom profile: " + className); } else { var customProfileInstance = Activator.CreateInstance(classType) as UnityInputDeviceProfile; InputManager.AttachDevice(new UnityInputDevice(customProfileInstance)); } } Debug.Log("InControl (version " + InputManager.Version + ")"); }