Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Foldout for certain properties without a custom editor?

Discussion in 'Editor & General Support' started by PaperMouseGames, Jun 4, 2019.

  1. PaperMouseGames

    PaperMouseGames

    Joined:
    Jul 31, 2018
    Posts:
    434
    Hi there, sorry if this isn't the right place to ask this, but I'm wondering if it's at all possible to have certain properties from a script (for example 10 [SerializeField] items) be under a foldout that can be collapsed without having to create a custom editor.

    I don't have much experience with custom editors but from what I remember, if you use that on a script then you have to make the entire script's inspector properties from scratch, and I didn't want to necessarily do that, I just wanna section off a particular section.

    Maybe it's not possible, but any help on what my options are to do what I'm trying would be appreciated, thanks!
     
  2. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,292
    It is possible, but in the end you'd need a custom editor to override all MonoBehaviour / ScriptableObjects editors to detect those attached attributes.

    There's plenty of implementations on the net.
    Here's a first one available in google:
    https://github.com/dimmpixeye/InspectorFoldoutGroup
     
  3. PaperMouseGames

    PaperMouseGames

    Joined:
    Jul 31, 2018
    Posts:
    434
    Thanks so much for the reply, so it sounds like my choices are to either use a custom editor, or download a sort of addon that uses a custom editor (or custom functionality?).

    That's fine, I guess I'll have to go and learn more about that stuff, I just wanted to know if there was a really quick and easy way to do this before I started spending hours learning and making custom editors.

    Thanks again!
     
  4. giuliano-marinelli

    giuliano-marinelli

    Joined:
    Mar 3, 2013
    Posts:
    3