Optional Order parameter for GroupAttribute - #115
Conversation
|
Thanks for the contribution, and I’m sorry this PR has been left without a review for so long. The underlying issue addressed here is valid: group ordering should be deterministic and should not depend on reflection discovery order. However, I don’t think adding an If you’re still interested in contributing this improvement, would you be willing to revise the implementation to use the existing [Group("Group1"), Order(10)]
[SerializeField]
float value;This would solve the original ordering problem while keeping a single, consistent API for ordering Inspector elements. Thanks again for identifying the problem and contribution! |
|
I’d like to revise my previous review comment. Group ordering and member ordering are separate concerns, so giving group attributes their own I plan to make the remaining adjustments on my side and merge this PR. Thank you for the original proposal, and sorry for the confusion. |
|
Thank you again for identifying this issue and providing the initial implementation. I’ve opened #154 with some adjustments to the implementation while keeping the original approach of giving groups their own order value. I’ll continue the work and merge the updated implementation through the new PR. Your contribution is credited in its description, so I’m closing this PR as superseded by #154. |
This PR introduces an optional int order parameter to the existing GroupAttribute, allowing inspector fields to be grouped and drawn in a defined sequence. Previously, reflection order could lead to unpredictable group ordering when fields are spread across base and derived classes.
Usage Example:
Inspector:
