Exemplo n.º 1
0
		public ICadeDevice( ICadeDeviceManager owner )
			: base( "iCade Controller" )
		{
			this.owner = owner;

			Meta = "iCade Controller on iOS";

			AddControl( InputControlType.DPadUp, "DPad Up" );
			AddControl( InputControlType.DPadDown, "DPad Down" );
			AddControl( InputControlType.DPadLeft, "DPad Left" );
			AddControl( InputControlType.DPadRight, "DPad Right" );

			AddControl( InputControlType.Action1, "Button 1" );
			AddControl( InputControlType.Action2, "Button 2" );
			AddControl( InputControlType.Action3, "Button 3" );
			AddControl( InputControlType.Action4, "Button 4" );
			AddControl( InputControlType.Button0, "Button 5" );
			AddControl( InputControlType.Button1, "Button 6" );
			AddControl( InputControlType.Button2, "Button 7" );
			AddControl( InputControlType.Button3, "Button 8" );

//			AddControl( InputControlType.LeftTrigger, "Left Trigger" );
//			AddControl( InputControlType.RightTrigger, "Right Trigger" );
//			AddControl( InputControlType.Select, "Select" );
//			AddControl( InputControlType.Start, "Start" );
		}
Exemplo n.º 2
0
        public ICadeDevice(ICadeDeviceManager owner)
            : base("iCade Controller")
        {
            this.owner = owner;

            Meta = "iCade Controller on iOS";

            AddControl(InputControlType.DPadUp, "DPad Up");
            AddControl(InputControlType.DPadDown, "DPad Down");
            AddControl(InputControlType.DPadLeft, "DPad Left");
            AddControl(InputControlType.DPadRight, "DPad Right");

            AddControl(InputControlType.Action1, "Button 1");
            AddControl(InputControlType.Action2, "Button 2");
            AddControl(InputControlType.Action3, "Button 3");
            AddControl(InputControlType.Action4, "Button 4");
            AddControl(InputControlType.Action5, "Button 5");
            AddControl(InputControlType.Action6, "Button 6");
            AddControl(InputControlType.Action7, "Button 7");
            AddControl(InputControlType.Action8, "Button 8");

//			AddControl( InputControlType.LeftTrigger, "Left Trigger" );
//			AddControl( InputControlType.RightTrigger, "Right Trigger" );
//			AddControl( InputControlType.Select, "Select" );
//			AddControl( InputControlType.Start, "Start" );
        }
Exemplo n.º 3
0
        internal static bool SetupInternal()
        {
            if (IsSetup)
            {
                return(false);
            }

                        #if !NETFX_CORE && !UNITY_WEBPLAYER && !UNITY_EDITOR_OSX && (UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
            Platform = (Utility.GetWindowsVersion() + " " + SystemInfo.deviceModel).ToUpper();
                        #else
            Platform = (SystemInfo.operatingSystem + " " + SystemInfo.deviceModel).ToUpper();
                        #endif

            initialTime    = 0.0f;
            currentTime    = 0.0f;
            lastUpdateTime = 0.0f;
            currentTick    = 0;

            deviceManagers.Clear();
            deviceManagerTable.Clear();
            devices.Clear();
            Devices      = new ReadOnlyCollection <InputDevice>(devices);
            activeDevice = InputDevice.Null;

            IsSetup = true;

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

                        #if UNITY_IOS
            if (EnableICade)
            {
                ICadeDeviceManager.Enable();
            }
                        #endif

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

            var addUnityInputDeviceManager = true;

                        #if UNITY_ANDROID && INCONTROL_OUYA && !UNITY_EDITOR
            addUnityInputDeviceManager = false;
                        #endif

            if (addUnityInputDeviceManager)
            {
                AddDeviceManager <UnityInputDeviceManager>();
            }

            return(true);
        }
Exemplo n.º 4
0
        internal static void Enable()
        {
            var errors = new List <string>();

            if (ICadeDeviceManager.CheckPlatformSupport(errors))
            {
                InputManager.AddDeviceManager <ICadeDeviceManager>();
            }
            else
            {
                foreach (var error in errors)
                {
                    Logger.LogError(error);
                }
            }
        }
Exemplo n.º 5
0
        internal static bool SetupInternal()
        {
            if (IsSetup)
            {
                return(false);
            }

#if !NETFX_CORE && !UNITY_WEBPLAYER && !UNITY_EDITOR_OSX && (UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
            Platform = Utility.GetWindowsVersion().ToUpper();
#else
            Platform = (SystemInfo.operatingSystem + " " + SystemInfo.deviceModel).ToUpper();
#endif

            enabled = true;

            initialTime          = 0.0f;
            currentTime          = 0.0f;
            lastUpdateTime       = 0.0f;
            currentTick          = 0;
            applicationIsFocused = true;

            deviceManagers.Clear();
            deviceManagerTable.Clear();

            devices.Clear();
            Devices = devices.AsReadOnly();

            activeDevice = InputDevice.Null;
            activeDevices.Clear();
            ActiveDevices = activeDevices.AsReadOnly();

            playerActionSets.Clear();

            // TO DO: Can this move further down after the UnityInputDeviceManager is added, which is more intuitive?
            // Currently it's used to verify we're in or after setup for various functions that are
            // called during manager initialization. There should be a safer way... maybe add IsReset?
            IsSetup = true;

            var enableUnityInput = true;

            var nativeInputIsEnabled = EnableNativeInput && NativeInputDeviceManager.Enable();
            if (nativeInputIsEnabled)
            {
                enableUnityInput = false;
            }

#if ENABLE_WINMD_SUPPORT && !UNITY_XBOXONE && !UNITY_EDITOR
            if (UWPDeviceManager.Enable())
            {
                enableUnityInput = false;
            }
#endif

#if UNITY_STANDALONE_WIN || UNITY_EDITOR
            if (EnableXInput && enableUnityInput)
            {
                XInputDeviceManager.Enable();
            }
#endif

#if UNITY_IOS || UNITY_TVOS
            if (EnableICade)
            {
                ICadeDeviceManager.Enable();
            }
#endif

#if UNITY_XBOXONE
            if (XboxOneInputDeviceManager.Enable())
            {
                enableUnityInput = false;
            }
#endif

#if UNITY_SWITCH
            if (NintendoSwitchInputDeviceManager.Enable())
            {
                enableUnityInput = false;
            }
#endif

            // TO DO: Can this move further down after the UnityInputDeviceManager is added, which is more intuitive?
            // Currently, it allows use of InputManager.HideDevicesWithProfile() to be called in OnSetup, which is possibly useful?
            if (OnSetup != null)
            {
                OnSetup.Invoke();
                OnSetup = null;
            }

#if UNITY_ANDROID && INCONTROL_OUYA && !UNITY_EDITOR
            enableUnityInput = false;
#endif

            if (enableUnityInput)
            {
                AddDeviceManager <UnityInputDeviceManager>();
            }

            return(true);
        }
Exemplo n.º 6
0
        internal static bool SetupInternal()
        {
            if (IsSetup)
            {
                return(false);
            }

#if !NETFX_CORE && !UNITY_WEBPLAYER && !UNITY_EDITOR_OSX && (UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN)
            Platform = Utility.GetWindowsVersion().ToUpper();
#else
            Platform = (SystemInfo.operatingSystem + " " + SystemInfo.deviceModel).ToUpper();
#endif

            enabled = true;

            initialTime          = 0.0f;
            currentTime          = 0.0f;
            lastUpdateTime       = 0.0f;
            currentTick          = 0;
            applicationIsFocused = true;

            deviceManagers.Clear();
            deviceManagerTable.Clear();
            devices.Clear();
            Devices      = new ReadOnlyCollection <InputDevice>(devices);
            activeDevice = InputDevice.Null;

            playerActionSets.Clear();

            // TODO: Can this move further down along with the OnSetup callback?
            IsSetup = true;

            var enableUnityInput = true;

            var nativeInputIsEnabled = EnableNativeInput && NativeInputDeviceManager.Enable();
            if (nativeInputIsEnabled)
            {
                enableUnityInput = false;
            }

#if UNITY_STANDALONE_WIN || UNITY_EDITOR
            if (EnableXInput && enableUnityInput)
            {
                XInputDeviceManager.Enable();
            }
#endif

#if UNITY_IOS
            if (EnableICade)
            {
                ICadeDeviceManager.Enable();
            }
#endif

#if UNITY_XBOXONE
            if (XboxOneInputDeviceManager.Enable())
            {
                enableUnityInput = false;
            }
#endif

            // TODO: Can this move further down after the UnityInputDeviceManager is added?
            // Currently, it allows use of InputManager.HideDevicesWithProfile()
            if (OnSetup != null)
            {
                OnSetup.Invoke();
                OnSetup = null;
            }

#if UNITY_ANDROID && INCONTROL_OUYA && !UNITY_EDITOR
            enableUnityInput = false;
#endif

            if (enableUnityInput)
            {
                AddDeviceManager <UnityInputDeviceManager>();
            }

            return(true);
        }
Exemplo n.º 7
0
        internal static bool SetupInternal()
        {
            if (IsSetup)
            {
                return(false);
            }

            Platform = Utility.GetPlatformName();

            enabled = true;

            initialTime          = 0.0f;
            currentTime          = 0.0f;
            lastUpdateTime       = 0.0f;
            currentTick          = 0;
            applicationIsFocused = true;

            deviceManagers.Clear();
            deviceManagerTable.Clear();

            devices.Clear();
            Devices = devices.AsReadOnly();

            activeDevice = InputDevice.Null;
            activeDevices.Clear();
            ActiveDevices = activeDevices.AsReadOnly();

            playerActionSets.Clear();

            MouseProvider = new UnityMouseProvider();
            MouseProvider.Setup();

            KeyboardProvider = new UnityKeyboardProvider();
            KeyboardProvider.Setup();

            // TODO: Can this move further down after the UnityInputDeviceManager is added, which is more intuitive?
            // Currently it's used to verify we're in or after setup for various functions that are
            // called during manager initialization. There should be a safer way... maybe add IsReset?
            IsSetup = true;

            var enableUnityInput = true;

            var nativeInputIsEnabled = EnableNativeInput && NativeInputDeviceManager.Enable();

            if (nativeInputIsEnabled)
            {
                enableUnityInput = false;
            }

                        #if ENABLE_WINMD_SUPPORT && !UNITY_XBOXONE && !UNITY_EDITOR
            if (UWPDeviceManager.Enable())
            {
                enableUnityInput = false;
            }
                        #endif

                        #if UNITY_XBOXONE
            if (XboxOneInputDeviceManager.Enable())
            {
                enableUnityInput = false;
            }
                        #endif

                        #if UNITY_GAMECORE
            if (GameCoreInputDeviceManager.Enable())
            {
                enableUnityInput = false;
            }
                        #endif

                        #if UNITY_SWITCH
            if (NintendoSwitchInputDeviceManager.Enable())
            {
                enableUnityInput = false;
            }
                        #endif

                        #if UNITY_STADIA
            if (StadiaInputDeviceManager.Enable())
            {
                enableUnityInput = false;
            }
                        #endif

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

                        #if UNITY_IOS || UNITY_TVOS
            if (EnableICade)
            {
                ICadeDeviceManager.Enable();
            }
                        #endif

            // TODO: Can this move further down after the UnityInputDeviceManager is added, which is more intuitive?
            // Currently, it allows use of InputManager.HideDevicesWithProfile() to be called in OnSetup, which is possibly useful?
            if (OnSetup != null)
            {
                OnSetup.Invoke();
                OnSetup = null;
            }

                        #if UNITY_ANDROID && INCONTROL_OUYA && !UNITY_EDITOR
            enableUnityInput = false;
                        #endif

            if (enableUnityInput)
            {
                                #if INCONTROL_USE_NEW_UNITY_INPUT
                AddDeviceManager <NewUnityInputDeviceManager>();
                                #else
                AddDeviceManager <UnityInputDeviceManager>();
                                #endif
            }

            return(true);
        }