TrueSyncBehaviours execution order

erreerre
Hi.

I saw that in TrueSyncManager, in initialize, there's a call FindObjectsOfType in order to find all true sync behaviors.
By Unity doc, you can't assume the ordering of the returned arrays.

So, if I have 2 TrueSyncBehaviour that consume Stamina, I can have:

- Player 0
---> run Behaviour A and cosume X energy
---> run Behaviour B and does not find enough energy to do the action

- Player 1
---> run Behaviour B and consume Y energy
---> run Behaviour A and does not find enough energy to do the action

Is this possible, right?

Have you ever thought a smart solution for problem like this? A sort of priority on Behaviours?

Thank you.
Andrea.

Comments

  • Hi Andrea,

    You are right, as it not well documented a different release of Unity or an update could change the order of the elements, in our tests we are always getting in a top-down hierarchy, but it is something to not rely on. Thanks for report that.
Sign In or Register to comment.