I’m considering a design where GameObjects are created programmatically by a “MainApp” instance (a MonoBehaviour / script bound to an Empty object) at Startup or Awake.
For each GameObject created, a corresponding “DomaninObject” (which inherits from Object, implements method Update()) would also be created.
A subclass of DomainObject might be BasketballPlayer.
A GameObject would be assigned to (stored in) each BasketballPlayer.
The MainApp instance would keep a reference to the collection of DomainObjects it created.
When MainApp receives Update() from Unity, it would invoke Update() on each of its domain objects. Each domain object, in turn, would manipulate its GameObject however it saw fit (change position, orientation, animation).
So: I would not be relying on Unity to send Update() to scripts attached to each GameObject in the scene (the “normal” approach?). Instead, a single script/MonoBehavior would receive a single update from Unity and dispatch that update “manually” to its “subordinates.”
Is there anything fundamentally wrong with doing things this way?
Thank you.