The IgnoreButtonForOneFrame method can be used if multiple objects are watching for a particular button to be pushed, but the first one that reacts to it should "consume" it so that no other objects get the button push. This method is very convenient because it does not require any additional logic aside from simply calling this method when consuming the button event.
In this example we have some if statements which increment a number according to button pushes. The first check for the A button will call IgnoreButtonForOneFrame on the A button. The first check for the B button will not. The result is that A will increment the call count by 1, while B will increment the call by 2.
Add the following using statement:
Add the following at class scope:
Add the following in Update: