void OnEnable() { SetupSingleton(); if (logDebugInfo) { Debug.Log("InControl (version " + InputManager.Version + ")"); Logger.OnLogMessage += LogMessage; } InputManager.InvertYAxis = invertYAxis; InputManager.EnableXInput = enableXInput; InputManager.XInputUpdateRate = (uint)Mathf.Max(xInputUpdateRate, 0); InputManager.XInputBufferSize = (uint)Mathf.Max(xInputBufferSize, 0); InputManager.SetupInternal(); 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 InputDeviceProfile; InputManager.AttachDevice(new UnityInputDevice(customProfileInstance)); } } if (dontDestroyOnLoad) { DontDestroyOnLoad(this); } }
void OnEnable() { if (logDebugInfo) { Logger.OnLogMessage += HandleOnLogMessage; } InputManager.InvertYAxis = invertYAxis; InputManager.EnableXInput = enableXInput; InputManager.SetupInternal(); 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 OnEnable() { if (EnforceSingleton() == false) { return; } InputManager.InvertYAxis = invertYAxis; InputManager.SuspendInBackground = suspendInBackground; InputManager.EnableICade = enableICade; InputManager.EnableXInput = enableXInput; InputManager.XInputUpdateRate = (uint)Mathf.Max(xInputUpdateRate, 0); InputManager.XInputBufferSize = (uint)Mathf.Max(xInputBufferSize, 0); InputManager.EnableNativeInput = enableNativeInput; InputManager.NativeInputEnableXInput = nativeInputEnableXInput; InputManager.NativeInputUpdateRate = (uint)Mathf.Max(nativeInputUpdateRate, 0); InputManager.NativeInputPreventSleep = nativeInputPreventSleep; if (InputManager.SetupInternal()) { if (logDebugInfo) { Debug.Log("InControl (version " + InputManager.Version + ")"); Logger.OnLogMessage -= LogMessage; Logger.OnLogMessage += LogMessage; } 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 UnityInputDeviceProfileBase; if (customProfileInstance != null) { InputManager.AttachDevice(new UnityInputDevice(customProfileInstance)); } } } } #if UNITY_5_4_OR_NEWER SceneManager.sceneLoaded -= OnSceneWasLoaded; SceneManager.sceneLoaded += OnSceneWasLoaded; #endif if (dontDestroyOnLoad) { DontDestroyOnLoad(this); } }
void OnEnable() { if (instance == null) { instance = this; if (dontDestroyOnLoad) { DontDestroyOnLoad(this); } } else if (this != instance) { isBeingDestroyed = true; //If destroying, we don't want to reset the InputManager Destroy(gameObject); } if (logDebugInfo) { Debug.Log("InControl (version " + InputManager.Version + ")"); Logger.OnLogMessage += HandleOnLogMessage; } InputManager.InvertYAxis = invertYAxis; InputManager.EnableXInput = enableXInput; InputManager.SetupInternal(); 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 OnEnable() { if (EnforceSingleton) { return; } InputManager.InvertYAxis = invertYAxis; InputManager.SuspendInBackground = suspendInBackground; InputManager.EnableICade = enableICade; InputManager.EnableXInput = enableXInput; InputManager.XInputUpdateRate = (uint)Mathf.Max(xInputUpdateRate, 0); InputManager.XInputBufferSize = (uint)Mathf.Max(xInputBufferSize, 0); InputManager.EnableNativeInput = enableNativeInput; InputManager.NativeInputEnableXInput = nativeInputEnableXInput; InputManager.NativeInputEnableMFi = nativeInputEnableMFi; InputManager.NativeInputUpdateRate = (uint)Mathf.Max(nativeInputUpdateRate, 0); InputManager.NativeInputPreventSleep = nativeInputPreventSleep; if (InputManager.SetupInternal()) { if (logDebugInfo) { Logger.OnLogMessage -= LogMessage; Logger.OnLogMessage += LogMessage; Logger.LogInfo("InControl (version " + InputManager.Version + ")"); } } #if UNITY_5_4_OR_NEWER SceneManager.sceneLoaded -= OnSceneWasLoaded; SceneManager.sceneLoaded += OnSceneWasLoaded; #endif if (dontDestroyOnLoad) { DontDestroyOnLoad(this); } }
void OnEnable() { if (originalInstance != null && originalInstance != this) { //Remove the duplicate Destroy(this.gameObject); return; } originalInstance = this; if (logDebugInfo) { Debug.Log("InControl (version " + InputManager.Version + ")"); Logger.OnLogMessage += HandleOnLogMessage; } InputManager.InvertYAxis = invertYAxis; InputManager.EnableXInput = enableXInput; InputManager.SetupInternal(); 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); } }
private void Start() { InputManager.SetupInternal(); }