Conversation
Added checkbox for using sorting group component. To use, add a sortingGroup component to the same object containing the IsoSpriteSorting component. Can likely be improved to support several hierarchies of sorting groups.
|
Quite new to github, apologies if I'm not doing this right! |
|
Looks like there are a few bugs to sort out already. Perhaps we can figure it out together! |
GameChecker4
left a comment
There was a problem hiding this comment.
Cannot use sorting on SortingGroup without selecting any one SpriteRenderer - that throwing a error
|
|
||
| cachedBounds = new Bounds2D(renderersToSort[0].bounds); |
There was a problem hiding this comment.
Add to this a UseSortingGroup check, to use sorting groups without selecting SpriteRenderer (like the Particle System or Spine Animation mesh). That fixes the sorting sorting error, but a full fix requires a change in IsoSpriteSorting.CalculateBoundsIntersection() to compare the objects without bounds with other (return true is a quick fix. I think the real calculation of bounds for these objects can be tricky, and not always the right solution)
| cachedBounds = new Bounds2D(renderersToSort[0].bounds); | |
| if (!UseSortingGroup) | |
| cachedBounds = new Bounds2D(renderersToSort[0].bounds); |
|
@olatan @GameChecker4 I've had a crack at fixing the issue with the bounds for game objects with multiple renderers, it might complement this PR #3 |
Added checkbox for using sorting group component.
To use, add a sortingGroup component to the same object containing the IsoSpriteSorting component.
Can likely be improved to support several hierarchies of sorting groups.