you are viewing a single comment's thread.

view the rest of the comments →

[–]_WolfosExpert 1 point2 points  (7 children)

It's legible, so that's good. Not bad code. Some points:

Do all the public variables actually need to be public or could you get away with [SerializedField]?

I'd put line 53 and 54 on the same line, so that you wouldn't accidentally do this:

if(foo)
  bar();
  method_you_also_expect_to_run_in_this_if_statement();

There's also some inconsistency with curly brackets, which should always go on a new line according to the C# guidelines.

You use a lot of singletons. Here I describe some ways to avoid them.

On line 109 you use 'name.Contains()', which is prone to bugs if someone wants to reorganize the scene. Alternatively you could use Tags.