On the advice of poemdexter, I’m going to redo pretty much all of the Away Team scripts that I have thus far. This is a little sad for me, as this marks the fifth iteration of the basic movement/combat mechanics; however I know that I need to get it all right, as it will form the core of the game. I think I had created a good set of object oriented classes and methods, but Unity (and, I suppose, C#) is all about the entity/component relationship, so here I go.
I’m not sure if this is the right way to go about the entity/component paradigm, but what I’ve been doing is planning out all of my components by kind of naming them with verbs. Before, I had a single “GridCharacter” component which attaches methods for A* movement, shooting, taking turns, and so forth. Now, I have components called CanFire, CanMoveOnGrid, TakesTurns, and quite a few others. I can already see the potential for this – for example, if I create a component called “CanBeShot,” then I can attach that to player characters, enemies, cars, terrain, and anything else I want to be able to be shot! This might be going too far, as this component would likely be very simple – maybe I just have a “HasHealth” component, and then attach a bool that allows an object to be shot or not.
In any case, hopefully I can do this well enough that I don’t have to have a sixth go-around!