Class LabelFieldAttribute
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
Specifies a field to use as label for an item in the inspector. This is especially useful for arrays of compound types.
[Version(2, 5, 0)]
[AttributeUsage(AttributeTargets.Field)]
public class LabelFieldAttribute : PropertyAttribute
- Inheritance
-
LabelFieldAttribute
- Inherited Members
- Extension Methods
Examples
In this example, the "type" field of ArrayItem will be used as the item label for the array in the inspector.
[Serializable]
public enum EnumNames
{
Label1,
Label2
}
[Serializable]
public class ArrayItem
{
public EnumNames type;
public int value;
}
public class LabelFieldTest : MonoBehaviour
{
[LabelField("type")]
public ArrayItem[] items;
}</code></pre>
Constructors
- LabelFieldAttribute(string)
Initializes a new instance of the LabelFieldAttribute class, indicating which field to use as labels in the inspector.
Properties
- LabelField
Gets the field to use as label for the item in the inspector.