Game Objects instantiated by GameObjectItemsSetter have a one frame delay before getting enabled

Issue #70 resolved
Christian Oeing repo owner created an issue

The game objects for the items are instantiated in the Start() method of the GameObjectItemsSetter on first initialization. This means the Start() method of an item game object is only called in the next frame (because Unity already decided which game objects to call Start() for).

Awake() and OnEnable() are called anyway, but the DataBindingOperator doesn't call Enable() before Start() was called (due to some other bug in the past where it's necessary that all Init() methods of the scripts of an instantiated game object are called before any Enable() method is called). Maybe it is okay now to remove that flag and call Enable() even before Start()? This has to be tested a lot as it may break other things.

On the other side the behaviour of the GameObjectItemsSetter is okay most of the time, but there may be cases where this isn't acceptable.

Comments (2)

  1. Christian Oeing reporter

    Removed the isStarted flag from DataBindingOperator and call Enable() in OnEnable(), even if Start() method wasn't called yet. This makes sure that the DataBindingOperator is initialized in the frame it is created instead of one frame later.

    The unit tests run successful, but I have to check if there are other bugs occuring that this flag fixed before.

  2. Log in to comment