Table of Contents

Class LabelFieldAttribute

Namespace
Gamelogic.Extensions
Assembly
Assembly-CSharp.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, _Attribute
Inheritance
LabelFieldAttribute
Implements
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)

public LabelFieldAttribute(string labelField)

Parameters

labelField string

Properties

LabelField

public string LabelField { get; }

Property Value

string