I apologize that this is not exactly Unity related, but I could not find any information on this elsewhere.
I have been wondering for a long time now what is the best way to use if statements. You can see what I mean by that below.
A single line if statement(contains several conditions):
if(X && Y && W && Z && G){
Execute();
}
And Many statements inside a statement.
if(X){
if(Y){
if(W){
if(Z){
if(G){
Execute();
}
}
}
}
}
In the end they all do the same thing I suppose, but obviously the first example looks a bit more neat than the latter, but are there any performance benefits(or any benefits for that matter) using either of these two examples?
Thank you,
Yours faithfully.