Unity: Simplify your if else statements with this EASY trick!

preview_player
Показать описание
Dont forget to like & subscribe for more Unity (quick) tips!
Simplify your if else statements with this EASY trick!

Check out some of my other Unity quick tips:

#gamedev #gamedev #shorts #unity #unitytips #unitytutorials #gamedevelopment #gametips #developer #unity3d #unity3dtutorial #programmering #csharp #visualstudio #rider #beginners #beginner #unitygameengine #programmering #unity3d #beginner #gamedev #quicktipp #quicktutorial #beginnerfriendly #tween #conditionalstatements

Creative Commons — Attribution 3.0 Unported — CC BY 3.0
Рекомендации по теме
Комментарии
Автор

I've been coding for over 45-years. I love using the conditional operator in my equations. However, I've learned that it makes code MUCH harder to read for other programmers and make it difficult to do additional work in each clause. Which is why I also suggest using the curly braces for each clause and don't use 'else if' tricks either.

Being tricky just makes your code hard to debug and maintain - which is typically 2x or more effort compared to the original coding effort.

rangleme
Автор

Might try this even I'm not the best at coding. Helps make my code more cleaner 😅

ipokillerg
Автор

Why do game developers wear glasses





































Because they can't C#

fhgwjxz
Автор

that is not more readable. its shorter. but not more readable

ThePlaskow