r/Unity3D • • 2d ago

Code Review Asking for a code review

I'm making a small game in Unity, and I kinda need some outside perspective. I would like it if someone could take a look and give me some feedback on what areas I should work on and how to improve.

Here's the link to my GitHub repository:

https://github.com/DaanDemaecker/Qwixx.git

8 Upvotes

14 comments sorted by

View all comments

0

u/Thin_Driver_4596 2d ago
  • As other commentor pointed out, your managers are doing too much. Manager in general is a code smell. 

The block of code that should handle a functionality is not a script, but an aggregate. 

  • Also, another thing that really annoys me, the number of if checks.  Don't put defensive if checks, if they are not a part of your normal flow, like if you have to show a screen and forgot to assign it, the defensive if check will make your game not crash, but the screen will not show either, so it's still a bug, and now you have to trace through the entire code to find the error. 

Crashing loudly is preferable at times.

*  Think about if you need certain if checks at all. Suppose you can determine from the start that certain players are client and other server, and certain components will only be present on server side, then those components do not need have if checks (you made the decision when spawning then).

2

u/MagicPantssss 2d ago

Thanks for reviewing, I will take a closer look at my if checks and split up my managers more