20
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 ...
Get Mastering UI Development with Unity - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.