https://github.com/thundertecke/press-and-repeat-interaction
Hold and repeat interaction for Unity Input System
https://github.com/thundertecke/press-and-repeat-interaction
events gamedev gamedevelopment input-system inputsystem interaction unity unity-interaction unity2d unity3d
Last synced: 10 months ago
JSON representation
Hold and repeat interaction for Unity Input System
- Host: GitHub
- URL: https://github.com/thundertecke/press-and-repeat-interaction
- Owner: ThunderTecke
- License: mit
- Created: 2022-12-10T16:45:32.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-10T22:15:31.000Z (over 1 year ago)
- Last Synced: 2024-09-11T02:44:42.446Z (over 1 year ago)
- Topics: events, gamedev, gamedevelopment, input-system, inputsystem, interaction, unity, unity-interaction, unity2d, unity3d
- Language: C#
- Homepage:
- Size: 10.7 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Press and repeat interaction
This interaction allows you to generate Input System events to manage a held key.
"Press" event can be activate to also generate an event on pressing the binding.
This interaction was developed with **Unity 2021.3.10f1** and **Input System 1.4.4**
## How to install
You can copy ``PressAndRepeatInteraction.cs`` script everywhere in your project folder. But preferably correctly oragnized.
For exemple, in ``Interactions`` folder.
## How to use
You just have to add the interaction on your action (or binding) with the ``+`` and select ``Press And Repeat``.
Then you have to adjust parameters on your convenience.
### Parameters
- ``Press`` : Used to activate ``press`` event. It's send on pressing. Just like normal action.
- ``Hold Time`` : Used to consider binding held, and send a second event.
- ``Repeating Time`` : Used to send next events with a constant time interval.