Heyas! I've been using Unity for a little while now, and I started being experienced enough to notice flaws in the architecture itself of code. I feel like I kind of developed an OCD for perfectly decoupled, all-generic, SOLID code, that I become somewhat embittered when I see any dependency in a class. I've searched everywhere on the web and nothing was fitting, so I'm starting to wander if what I'm looking for even exists.
I know architecture patterns depend on the project's size, but I'd like to find one that suits me best that I could use even for smaller projects, just to develop good practices. Do tell me if that's an error though.
What would be all the things I can do to get an extremely decoupled code ? I want to be able to have "conversations" between systems (UI, gameplay,...) with basically no dependency directly.
Also, what would be the ""best"" game flow pattern for this?
I've started working on a new project recently, and used a finite state machine for the flow. However, I started running into issues with states depending on UI stuff, but none of the solutions I've found were really fitting (right now I pass the State Machine to the states' Enter and Exit methods, and in this machine lies a reference to a "GameContext" class holding a bunch of different references - but still this doesn't really suit me because if exposes a bunch of different stuff that is all needed but not all needed by a single state). How would I go about that?
I'm mainly looking for more general solutions, or good rules of thumb.
Thank you for reading and for answering if you do, I hope it's not too long.