Fixed order_by when using a shared component by multiple prefabs #1086
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have a component
which I use as a common component for my game entities. Game entities are implemented through Prefab.
Since
VisualComponent
is not modified for different instances, I add it to the prefab. However, its data differs between different prefabs.The issue arose when I tried to use this component in
order_by
.order_by
works incorrectly due to this check in theorder_by
logic:Because of it, when creating a new instance, no resorting occurs.
I understand that this check was added because if prefab instances for sorting use a shared component, this component will be the same for all instances, so there is no point in resorting. But there is also no point in such sorting in principle. So, using
order_by
with a shared component and when you have only one prefab makes no sense.However, if you have a component that is used in several different prefabs and has different data in these prefabs, then this check breaks the logic of how
order_by
works, as in my example above.So, my suggestion is to remove this check so that
order_by
can be used for my case