Script structuring?

I’ve finished coding a scoring system for my simple game, but I’m wondering how to structure the scoring system itself to make it fit more nicely into the Unity design. Seeing Unity is designed to be bottom-up (Entities owns Logic):

should I have the entities register themselves with a score keeper (another entity), or

should I have a score keeper to keep track all entities?

If it helps, the game is where the player controls a square, and has to avoid dots that are flying everywhere on the screen. Whenever the a dot exit the screen, the score goes up.

EDIT: the dots are spawned by a spawn manager if that helps a bit

If you can do it efficiently, it makes more sense for the score keeper to keep track of the entities.
But if it’s more efficient for the entities to register themselves with the score keeper, then do it that way.

How are you detecting the dots that exit the screen? I’m assuming you use colliders. On the colliders, attach a script on it that references a script on an empty gameobject. That gameobject should be called the Game Controller. Have a script specific to said GameController. When the collider detects a dot, it should call a function on the GameController which controls the score.

If you need any code feel free to comment on this, just make sure you tell me your language :wink: