Unity architecture : Communication among objects/systems how you do it?

I use the the observer pattern with regular c# events. Its fastest and makes the most sense for me.

A lot of the wiring logic often goes into abstract classes or is enforced through certain interfaces, just to keep things organized. But I also added a static registry to my game.

When a certain types of game object is loaded it will register itself with the registry and later remove itself when destroyed. At my skill level it was a bear to code but basically it parses the objects into their own specific collections of classes, like all enemies vs all robots & monsters. There are even sub collections for objects that are enabled and which ones are not.

So while I cant "talk" to any one specific game object this way, it makes it easy to iterate over the specific sets and do things like, "all robots will self destruct"

For my purposes, this means that game uses more memory but it cuts down computation because the registry is only updated when something is created, destroyed, activated or deactivated, which mostly occurs during loading screens and room transitions anyway

/r/Unity3D Thread