Introduction
Reducing lines of code can make your work more readable, making it easier for you and for others to read. More lines means more mental gymnastics to decipher which part of code does what. I want to go over some tips and tricks that helpd me.
This is a guide I’ll update periodically if I discover new line saving tricks. If you know one that I haven’t put in, post a comment below to let me know and it may end up in the guide!
Smart Booleans
A real line saving trick is being smart with booleans. Below is a typical scenario you might have with turning off an objects animator once a counter has finished counting down.
void Update() { counter--; if(counter > 0) { animator.enabled = true; } else …
View original post 1,696 more words
Leave a Reply