Isn’t there a general parameter that I can give Unity to have it perform a specific task when a specific button has been pressed?
I understand that with the if-Statements that we call every frame, we are telling Unity to check whether a specific button has been pressed or not and what to do if said button has been pressed. But that seems rather performance-draining on larger games where there may be several hundred if-Statements that need to be checked each frame.
So can I not simply state that instead of checking whether a button has been pressed or not, Unity should simply not do anything until the button press has been made and then perform the associated task?
Because I don’t see that going well regarding performance on a game that runs 30 frames per second or more and Unity has to check a hundred if-Statements 30 times a second.
Not to mention with some type of games like competitive shooters, players fight for every millisecond less delay. So in those cases would it even be enough to call an if-Statement once every frame or would you have to double it to get an almost 0-delay-reaction which in return would also create twice the load on performance.
Sorry for the long description