Fixed order_by when using a shared component by multiple prefabs#1086
Open
klechenov wants to merge 1 commit intoSanderMertens:masterfrom
Open
Fixed order_by when using a shared component by multiple prefabs#1086klechenov wants to merge 1 commit intoSanderMertens:masterfrom
klechenov wants to merge 1 commit intoSanderMertens:masterfrom
Conversation
Owner
|
Can you provide a runnable code example that reproduces your scenario? This change breaks existing behavior- but maybe there's a way to make both work. |
Author
|
@SanderMertens yeah, sure. here it is - https://gist.github.com/klechenov/a3708b1385704871d4bbf04634c6d4fc the result without order_by will be: the result with order_by will be: |
438bde4 to
220852f
Compare
3b99938 to
ac6cdca
Compare
7874ea5 to
f479787
Compare
ace232e to
b968586
Compare
301243a to
4a5784f
Compare
34dc148 to
c9b99e0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
VisualComponentis 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_byworks incorrectly due to this check in theorder_bylogic: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_bywith 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_byworks, as in my example above.So, my suggestion is to remove this check so that
order_bycan be used for my case