Game.UI.Widgets.ListElementLabelAttribute
Assembly: Game (Assembly containing the game's UI widgets)
Namespace: Game.UI.Widgets
Type: public class
Base: UnityEngine.PropertyAttribute
Summary:
A marker attribute used by the game's UI/widget system to indicate that a field should be treated as the label for elements in a list. This attribute contains no data or behavior itself; it exists solely as a declarative hint consumed by the UI toolchain or custom inspectors/renderers that present list elements.
Fields
- None
This attribute defines no instance or static fields.
Properties
- None
There are no properties declared on this attribute.
Constructors
public ListElementLabelAttribute()
A default parameterless constructor is provided implicitly. Use this attribute by placing it above a field declaration to mark that field as the label for list elements.
Methods
- None
No methods are declared; the attribute is a simple marker type deriving from PropertyAttribute.
Usage Example
using Game.UI.Widgets;
using UnityEngine;
public class ExampleListItem : MonoBehaviour
{
// Mark this field as the label shown for each element in a list
[ListElementLabel]
public string label;
// Other data for the list element
public int id;
public Sprite icon;
}
Notes: - In C#, attributes named XAttribute can be used as [X]; here you can write [ListElementLabel] above the field. - The actual effect depends on the UI rendering code or custom property drawer/inspector that looks for this attribute and uses it to determine which field to show as the list element label.