{"id":16209933,"url":"https://github.com/annulusgames/reactiveinputsystem","last_synced_at":"2025-10-15T20:06:25.888Z","repository":{"id":219029918,"uuid":"747962855","full_name":"annulusgames/ReactiveInputSystem","owner":"annulusgames","description":"Reactive Extensions for Unity Input System","archived":false,"fork":false,"pushed_at":"2024-01-25T02:02:00.000Z","size":1683,"stargazers_count":22,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-02T03:24:16.548Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/annulusgames.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-25T01:32:44.000Z","updated_at":"2025-02-17T00:16:50.000Z","dependencies_parsed_at":"2024-01-25T04:23:56.623Z","dependency_job_id":"ba30263d-9a01-49ed-8007-522e90693925","html_url":"https://github.com/annulusgames/ReactiveInputSystem","commit_stats":null,"previous_names":["annulusgames/reactiveinputsystem","yn01dev/reactiveinputsystem","yn01-dev/reactiveinputsystem"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annulusgames%2FReactiveInputSystem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annulusgames%2FReactiveInputSystem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annulusgames%2FReactiveInputSystem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annulusgames%2FReactiveInputSystem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/annulusgames","download_url":"https://codeload.github.com/annulusgames/ReactiveInputSystem/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241481972,"owners_count":19969833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T10:34:13.697Z","updated_at":"2025-10-15T20:06:20.851Z","avatar_url":"https://github.com/annulusgames.png","language":"C#","readme":"# ReactiveInputSystem\n Reactive Extensions for Unity Input System\n\n[![license](https://img.shields.io/badge/LICENSE-MIT-green.svg)](LICENSE)\n\n[日本語版READMEはこちら](README_JA.md)\n\n## Overview\n\nReactiveInputSystem is a library that provides functionality to convert events and device inputs from the Input System into Observables.\n\n## Setup\n\n### Requirements\n\n* Unity 2021.3 or later (Unity 2022.2 or later recommended)\n* Input System 1.0.0 or later\n* R3 0.1.0 or later\n\n### Installation\n\n1. Open Package Manager from Window \u003e Package Manager.\n2. Click the \"+\" button \u003e Add package from git URL.\n3. Enter the following URL:\n\n```plaintext\nhttps://github.com/AnnulusGames/ReactiveInputSystem.git?path=src/ReactiveInputSystem/Assets/ReactiveInputSystem\n```\n\nAlternatively, open Packages/manifest.json and add the following to the dependencies block:\n\n```json\n{\n    \"dependencies\": {\n        \"com.annulusgames.reactive-input-system\": \"https://github.com/AnnulusGames/ReactiveInputSystem.git?path=src/ReactiveInputSystem/Assets/ReactiveInputSystem\"\n    }\n}\n```\n\n## Extension Methods\n\nBy introducing ReactiveInputSystem, extension methods are added to convert events from `InputAction`, `PlayerInput`, `PlayerInputManager`, and others into Observables.\n\n```cs\nusing UnityEngine.InputSystem;\nusing R3;\nusing ReactiveInputSystem;\n\nInputAction inputAction;\n\ninputAction.StartedAsObservable(cancellationToken)\n    .Subscribe(x =\u003e ...);\ninputAction.PerformedAsObservable(cancellationToken)\n    .Subscribe(x =\u003e ...);\ninputAction.CanceledAsObservable(cancellationToken)\n    .Subscribe(x =\u003e ...);\n\nPlayerInput playerInput;\n\nplayerInput.OnActionTriggeredAsObservable(cancellationToken)\n    .Subscribe(x =\u003e ...)\n```\n\n## Device Input\n\nYou can obtain input from any device as an Observable using the `InputRx` class.\n\n```cs\nInputRx.OnKeyDown(Key.Space)\n    .Subscribe(_ =\u003e ...);\n\nInputRx.OnMousePositionChanged()\n    .Subscribe(x =\u003e ...);\n\nInputRx.OnGamepadButtonDown(GamepadButton.North, cancellationToken)\n    .Subscribe(_ =\u003e ...);\n```\n\nAdditionally, using the `OnAny**` methods allows you to retrieve information about the pressed button.\n\n```cs\nInputRx.OnAnyKeyDown()\n    .Subscribe(key =\u003e ...);\n\nInputRx.OnAnyMouseButtonUp()\n    .Subscribe(mouseButton =\u003e ...);\n\nInputRx.OnAnyGamepadButton()\n    .Subscribe(gamepadButton =\u003e ...);\n```\n\n## Other Events\n\n`InputRx` provides methods to convert events from the `InputSystem` class and events from `InputUser` into Observables.\n\n```cs\n// InputSystem.onAfterUpdate\nInputRx.OnAfterUpdate()\n    .Subscribe(_ =\u003e ...);\n\n// InputSystem.onAnyButtonPress\nInputRx.OnAnyButtonPress()\n    .Subscribe(control =\u003e ...);\n\n// InputUser.onChange\nInputRx.OnUserChange()\n    .Subscribe(x =\u003e ...);\n```\n\n## InputControlPathEx\n\nAs a utility for Control Path-related operations, the `InputControlPathEx` class is provided.\n\nYou can use `InputControlPathEx.GetControlPath()` to obtain a Control Path from enumerations such as `Key`, `MouseButton`, `GamepadButton`, etc. This can be useful when implementing interactive rebinding, for example, with `InputRx.OnAny**()`.\n\n```cs\nInputAction inputAction;\n\nasync Task RebindAsync(CancellationToken cancellationToken)\n{\n    inputAction.Disable();\n\n    var path = await InputRx.OnAnyKeyDown(cancellationToken)\n        .Select(x =\u003e InputControlPathEx.GetControlPath(x))\n        .FirstAsync();\n\n    inputAction.ApplyBindingOverride(0, path);\n    inputAction.Enable();\n}\n```\n\n## License\n\n[MIT License](LICENSE)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannulusgames%2Freactiveinputsystem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fannulusgames%2Freactiveinputsystem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannulusgames%2Freactiveinputsystem/lists"}