Polling vs subscribing
We discussed the Input Manager in Chapter 8 and up until recently, it was the only way to track inputs from devices in a Unity-built game. When using the Input Manager, you assign specific Axes to different input actions. You then write a C# script that constantly checks to see if that action is performed.
Figure 20.4: C# script watching for specific inputs defined by the Input Manager
To accomplish this, your code would look something like the following pseudocode:
void Update () { if (some input happened){ do something } }
This technique of requesting information at a regular interval, is called polling. You can use the polling pattern for accessing information from the Input System in a similar way that you could with the Input Manager. However, to make your code more modular, most of your code when using...