Search Unity

Feedback Feature request: Collapsible groups inside the inspector

Discussion in 'Editor & General Support' started by Marscaleb, Feb 16, 2020.

  1. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    I have some scripts that have very long lists of variables I can access within the inspector. It makes things a little cluttered and hard to navigate.
    It would be nice if I could set some variables to be within certain "groups" that could be collapsed/expanded so that I only need to see the variables I actually want to work with.

    Here's an example. This is a screenshot of on of my player classes:

    Rather long and convoluted.
    But what if I could make it look like this:


    Much cleaner and easier to organize!

    I imagine this working by declaring a simple tag above any variable in the script, similar to how I can state "serialize" or "hide in inspector," or add a header attribute.
    Also, I would appreciate it if these groups could be arbitrarily collected from any specified public/serialized variable. So say for example I have a group of variables I made for one class, and then I made another class that extended from the first class. It would be great if my second class could have some of its variables included in a group that was made in the first class. That would make it easier to organize variables according to any arbitrary design I want, so if I have a new variable that makes sense to add to an existing group, I could still do that.
    But if cross-class grouping can't be done, I would still be satisfied just to make groups so I can hide variables I would rarely change.