making a menu like player setting

hi, i searched a lot about this title. but i can’t figure out a way to do this.

i just want to have a script that generate a list of Areas (like the player setting), when i click on one of them, it will expand.

you can see the shape for more detail.

Thank you


Something like this seems to fit your needs. You can modify something here and there to your liking.

I’m not sure what exactly you have issues with or what doesn’t work as you desire. The PlayerSettings editor does essentially use a Foldout (just a specialized internal version of it).

This internal method is used to create one of the sections. It essentially shows a Foldout and a uses an AnimBool and a FadeGroup to “dynamically” expand / contract a section.

Here’s where the different sections are drawn inside the OnGUI method of the editor.

A lot of the built-in editors uses specialized subroutines which are often internal methods which you can not use. So if you want the exact same behaviour you have to recreate it yourself. Note that the GitHub repository is for reference only. So you are not allowed to copy or use any of the provided code. However you can of course implement your own version of a certain method.

You actually shouldn’t focus too hard on how it’s implemented in the PlayerSettings editor. The Unity editor is pretty much a patchwork of many different programmers and programming styles since different people worked on different parts. You should focus more on what exact behaviour you’re looking for and what you specifically need.

thank. but problem doesn’t solved