Sorry for the incredibly basic question, but it’s something I’ve been wondering about that I’d like to ask - (in regards to performance optimization and basic understanding that I’ve missed along the way)
Given something as simple as this:
void Update()
{
if (Input.GetKey("escape"))
Application.Quit();
}
Does C# or the compiler (or whatever, feel free to correct that language) check to see if the if statement is valid every frame, or does it just skip this and treat it like an event call or something?
In other words - if your game is just running idle - play button on with no input happening - you’re just staring at the screen - what’s happening behind the scenes? Is the engine checking this if statement every frame with everything in Input or is it more like it’s just waiting for Input to send a message or something?
Thanks again for any clarification, hopefully someone finds some enjoyment in trying to answer this for me : )