Skip to content

Instantly share code, notes, and snippets.

@solsnare
Created December 24, 2023 03:55
Show Gist options
  • Save solsnare/3ccb2c9669b138a6cdbae5fe44cb8a97 to your computer and use it in GitHub Desktop.
Save solsnare/3ccb2c9669b138a6cdbae5fe44cb8a97 to your computer and use it in GitHub Desktop.
Simple Component Grouping tool for Unity. Helps organize your inspector!
//Made by Soltar @sullysaysyes on twitter
using UnityEngine;
public class ComponentGroup : MonoBehaviour
{
// Start is called before the first frame update
public string Name = "GROUP NAME";
public Component[] _componentsInGroup = null;
public bool _showGroup = false;
private void OnValidate()
{
foreach(var c in _componentsInGroup)
{
c.hideFlags = (_showGroup) ? HideFlags.None : HideFlags.HideInInspector;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment