Hello,
Are there any guarantees made to the execution order of components?
Specifically, if I have a component a and a component b, can I be sure that b will receive exactly 1 update between any given 2 sequential updates of a? Must I assume it is possible that a may have 2 updates before b receives any, forcing a two-frame window for state checks, and complicating the matter beyond a simple bit switch?
Thanks for any insight you can give.
Just to expand on what I originally wrote:
I need to set some state indicating when a component has made a change. To do this, I expose a bool, and set it to true whenever the change occurs, which is somewhere in the scope of the Update() method. At the start of Update(), I set the flag to false. The result is, the flag is on for the rest of the frame that the change was made in, and from the start of the next frame until Update() is called again on the component.
With a guaranteed execution order, I can be sure that this flag can be seen by all other components.
Without, I cannot be sure of that, and must extend the flagās lifetime to two frames to be sure it is seen by all observers. The complications this introduces are not significant, but better to be avoided.