I have been redesigning all my entities in Unity in the hopes that they will be more modulated and the components will be less dependent on each other. However, I have run into problems that I can't seem to get around.
If I have two script components on an entity, for example, PlayerInput and PlayerState. PlayerInput would take input and use it in some meaningful way, and PlayerState would manage the state of the player. PlayerState might hold some data that describes what state the player is in. The problem is if that state data is needed for dealing with input, then there's not much of an option but to create a dependency, or change the base game object class( which I can't do, and probably wouldn't be a good idea anyway. )
Of course sending messages is only useful for giving out information, and not requesting it. Should I even be trying to share data across components, or is that implying a dependency in itself? What am I doing wrong in this situation?