Tasks do not complete in the order they were started #613
Unanswered
JohannesPaivinen
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
We are using UniTask to run visualizations in our puzzle game and have observed an issue when running multiple tasks with equal duration. They do not complete in the order they started. For example, this code
Would start tasks 0-1-2 but complete 0-2-1.
This behavior is caused by the way UniTask manages player loop items in PlayerLoopRunner. When an item is completed, it's removed from the item array by swapping, which alters the order in which the remaining items are updated.
We would prefer that the item would be removed by copying, which would retain the order of the other items.
Would you consider making this behavior toggleable by a setting in UniTask?
Or is there another way to accomplish the same result?
Beta Was this translation helpful? Give feedback.
All reactions