Exemple #1
0
        public static void Enable()
        {
            var errors = new List <string>();

            if (XInputDeviceManager.CheckPlatformSupport(errors))
            {
                HInput.HideDevicesWithProfile(typeof(Xbox360WinProfile));
                HInput.HideDevicesWithProfile(typeof(XboxOneWinProfile));
                HInput.HideDevicesWithProfile(typeof(LogitechF710ModeXWinProfile));
                HInput.HideDevicesWithProfile(typeof(LogitechF310ModeXWinProfile));
                HInput.AddDeviceManager <XInputDeviceManager>();
            }
            else
            {
                foreach (var error in errors)
                {
                    Logger.LogError(error);
                }
            }
        }
Exemple #2
0
        internal static void SetupInternal()
        {
            if (_isSetup)
            {
                return;
            }

            Platform = "{0} {1}".With(SystemInfo.operatingSystem, SystemInfo.deviceModel).ToUpper();

            _initialTime    = 0.0f;
            _currentTime    = 0.0f;
            _lastUpdateTime = 0.0f;
            _currentTick    = 0;

            DeviceManagers.Clear();
            devices.Clear();
            Devices       = new ReadOnlyCollection <InputDevice>(devices);
            _activeDevice = InputDevice.Null;

            _isSetup = true;

#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
            if (EnableXInput)
            {
                XInputDeviceManager.Enable();
            }
#endif

            if (OnSetup != null)
            {
                OnSetup.Invoke();
                OnSetup = null;
            }

#if !(UNITY_ANDROID && INCONTROL_OUYA && !UNITY_EDITOR)
            AddDeviceManager <UnityInputDeviceManager>();
#endif
        }