The New Input System
Unity’s Input System (colloquially referred to as the new Input System) allows you to make the code concerning how your game reacts to interactions from various input devices more modular. The old Input System used the Input Manager to allow you to define various Axes that could be referenced in code (see Chapter 8). You would create checks in your Update()
method to determine if a device received an input. This usually results in multiple if-else branches within your Update()
method that control what happens for each input received.
The Input System divorces the handling of individual input devices from code by using an event-based programming methodology. Instead of having to create reference to each of your input devices within your code, you create code that reacts to specific actions. The Input System then controls which Interaction from which Input devices trigger these actions.
This separation of input handling and code allows you to make more...