I’m struggling with the code design in this section, I’m a software engineer and coding in Unity is sometimes counter intuitive. I’m trying to understand good Unity code design here but the things that seem counter intuitive to me.
- We’re grabbing mouse input in different classes, which seems like it can get lost. Is this common in Unity? I would normally think of this as collecting mouse input in a single place and dispatching that to the appropriate handler.
- Using a return in the Update method of the UnitActionSystem breaks out of the entire method right? Seems like this is going to be a problem if we have any code after it we still want to execute. I’d normally think to use something like break instead, Is that a bad practice in unity? (or to point 1, it would dispatch to the right handler and I wouldn’t have to break at all.)