Thanks for info.
I have refactored this as well, so that it’s no longer recursive at all.
When TrySortConnectionsByPositionX is called, only the parent node connection really need to be sorted.
Initially, I opted to do this recursively for “more safety”, but I don’t think it’s really required to be honest considering the performance drawback in large/deep trees 🙂
1
2
3
4
5
6
7
8
9
10
//Editor. Sorts the parent node connections based on all child nodes X position. Possible only when not in play mode.