Пример #1
0
        public List <RLocalInputDescription> DiscoverInputDevices()
        {
            var devices = new List <RLocalInputDescription>();

            var keyboard      = new RLocalInputDescription();
            var keyboardInput = new RLocalKeyboardInput();

            keyboard.type           = RLocalInputDeviceType.KEYBOARD;
            keyboard.name           = "Keyboard";
            keyboard.keyboardDevice = keyboardInput;
            devices.Add(keyboard);

            var gamepads = RLocalGamepadInput.GetAvailableGamepads();

            gamepads.ForEach(gamepad =>
            {
                var inputDescription = new RLocalInputDescription();

                inputDescription.name = gamepad.name;
                inputDescription.type = RLocalInputDeviceType.GAMEPAD;
                inputDescription.gamepadDescription = gamepad;

                devices.Add(inputDescription);
            });

            this.devices = devices;
            return(devices);
        }
Пример #2
0
 public void AssignGamepad(RLocalGamepadDescription gamepadDescription)
 {
     gamepad = new RLocalGamepadInput();
     gamepad.AssignGamepad(gamepadDescription);
 }