Skip to content

Instantly share code, notes, and snippets.

@solsnare
Created December 24, 2023 23:16
Show Gist options
  • Save solsnare/7d6bf5fa3a10910977aa8f83e5927509 to your computer and use it in GitHub Desktop.
Save solsnare/7d6bf5fa3a10910977aa8f83e5927509 to your computer and use it in GitHub Desktop.
ComponentGrouping for Unity to help with messy inspectors. Odin version to really fix the UX.
using UnityEngine;
using Sirenix.OdinInspector;
public class ComponentGroup : MonoBehaviour
{
// Start is called before the first frame update
public string Name = "GROUP NAME";
[InlineEditor,OnInspectorInit("OnValidate")]
public Component[] _componentsInGroup = null;
private void OnValidate()
{
foreach (var c in _componentsInGroup)
{
c.hideFlags = HideFlags.HideInInspector;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment