Publisher | hai_25 |
---|---|
File size | 43.70kB |
Number of files | 12 |
Latest version | 1 |
Latest release date | 2024-07-16 08:10:23 |
First release date | 2024-07-16 08:10:23 |
Supported Unity versions | 2018.4.2 or higher |
The Groupable Fields Package offers customizable organization of serialized fields in the Unity Inspector into collapsible groups, easily implemented into existing projects. Suitable for any genre, it enhances project clarity and usability.
# How to use!
- Create an editor script and add this to the Editor tag (Line above the class)
- [CustomEditor(typeof(NameOfYourScript), true), CanEditMultipleObjects]
- ", true), CanEditMultipleObjects]" - This part is incredibly important!
- Add this line to the top of the editor script:
- using Hai.EditorUtilities;
- Dont forget to execute the base.OnInspectorGUI() method!
- Just like this:
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
}
Now for the script portion:
- Add this line to the top of the script you were going to edit with editor script:
- using Hai.EditorUtilities;
This will now put all of the inspector fields, into an "Ungrouped" Group.
All you need to do is to freely define your own groups!
Like this:
- [FoldoutGroup("My Favourite Foldout", ColorPalette.Options.White)]
- [FoldoutGroup("This is all it takes", ColorPalette.Options.Blue)]
Remember, the FoldoutGroup will automatically grab all the fields and put them into the group, untill it finds a NEW FoldoutGroup definition.
No need to define the same FoldoutGroup for every field!