Created
December 24, 2023 23:16
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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