Is it better to have an Update() script in each of N GameObjects, or just in a single centralized GameObject, that references the N other objects by name?
When compiled, is there a difference between the two?
Is it better to have an Update() script in each of N GameObjects, or just in a single centralized GameObject, that references the N other objects by name?
When compiled, is there a difference between the two?
I do not know what Unity does exactly internally, but there must be some kind of iteration (for-loop) over all game objects to call the update()-routine.
It is the exact thing you would do in your centralized GameObject, so I would not expect a benefit performance-wise.
On the other hand, having an update()-method in each game object (as intended by the engine) is easier to read and understand than having the proxy-object, so I would go for that.
If your N is very large and you have to be sure, I would measure the difference in performance.