Class GroupAttribute
Assigns an organizational group path to a type so that editor tooling and reflection-based systems can categorize and present it within a logical hierarchy.
Inherited Members
Namespace: Scylla.Core.Attributes
Assembly: ScyllaCore.dll
Syntax
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Interface, Inherited = false)]
public sealed class GroupAttribute : Attribute
Remarks
When Scylla editor tools enumerate types for display - such as component pickers, type-selection dropdowns, or documentation browsers - they can use the GroupAttribute to organize results into a tree or categorized list rather than a flat alphabetical sequence. This makes large collections of types much easier to navigate.
The group path is specified as a slash-delimited string using "/" as the
hierarchy separator, following the same convention used by Unity menus and asset
paths. Each segment of the path represents one level of nesting, with no limit on
depth. For example, "AI/Enemies/Ranged" places the type three levels deep
under the AI root, inside the Enemies subcategory.
Within a group, types can be given an explicit display order via the Order property. Items are sorted by ascending Order value, so lower numbers appear first. Negative values are valid and can be used to pin important types above the default zero-ordered items. When two types share the same Order value, tooling typically falls back to alphabetical ordering by display name.
This attribute is purely organizational metadata and has no effect on runtime
behavior. It is non-inherited (Inherited = false), so subclasses must
declare their own GroupAttribute if they belong to a group.
GroupAttribute is often combined with DisplayNameAttribute to provide both a friendly label and an organizational category, and optionally with HideInFilterWindowAttribute to suppress a type from appearing even within its assigned group.
Basic grouping - placing two types in the same category:
[Group("AI/Enemies")]
public class ZombieAI : MonoBehaviour { }
[Group("AI/Enemies")]
public class SkeletonAI : MonoBehaviour { }
Controlling display order within a group:
[Group("AI/Allies", Order = 10)]
public class CompanionAI : MonoBehaviour { }
[Group("AI/Allies", Order = -1)]
public class EscortTargetAI : MonoBehaviour { }
/* EscortTargetAI appears before CompanionAI because -1 < 10. */
Deep hierarchical path - arbitrary nesting depth is supported:
[Group("Combat/Weapons/Ranged/Projectile")]
public class ArrowController : MonoBehaviour { }
Reading the attribute at runtime via reflection:
var attr = typeof(ZombieAI).GetCustomAttribute<GroupAttribute>();
if (attr != null)
Debug.Log($"{attr.Path} (order {attr.Order})"); // "AI/Enemies (order 0)"
Constructors
GroupAttribute(string)
Initializes a new GroupAttribute with the required group path.
Declaration
public GroupAttribute(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | The slash-delimited organizational path that identifies the group this type
belongs to, for example |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when |
Properties
Order
Gets or sets the display order of this type within its group, relative to other types assigned to the same group path.
Declaration
public int Order { get; set; }
Property Value
| Type | Description |
|---|---|
| int | An integer sort key. Lower values are displayed first; higher values are displayed
last. The default is |
Remarks
Set this property via the attribute initializer syntax:
[Group("AI/Allies", Order = 10)]
The Order value is local to the group identified by Path - it does not affect ordering between different top-level group categories.
Path
Gets the slash-delimited group path that defines where this type sits in the organizational hierarchy.
Declaration
public string Path { get; }
Property Value
| Type | Description |
|---|---|
| string | A non-null, non-empty string using |
Remarks
Segments may contain spaces and most printable characters. The framework does not impose further restrictions on segment content beyond requiring the overall string to be non-empty.