Click or drag to resize

LabelFieldAttribute Class

Specifies a field to use as label for an item in the inspector. This is especially useful for arrays of compound types.
Inheritance Hierarchy
SystemObject
  SystemAttribute
    PropertyAttribute
      Gamelogic.ExtensionsLabelFieldAttribute

Namespace:  Gamelogic.Extensions
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
[VersionAttribute(2, 5, 0)]
[AttributeUsageAttribute(AttributeTargets.Field)]
public class LabelFieldAttribute : PropertyAttribute

The LabelFieldAttribute type exposes the following members.

Constructors
  NameDescription
Public methodLabelFieldAttribute
Top
Properties
  NameDescription
Public propertyLabelField
Public propertyorder

Optional field to specify the order that multiple DecorationDrawers should be drawn in.

(Inherited from PropertyAttribute.)
Public propertyTypeId (Inherited from Attribute.)
Top
Methods
  NameDescription
Public methodEquals (Inherited from Attribute.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Attribute.)
Public methodGetType (Inherited from Object.)
Public methodIsDefaultAttribute (Inherited from Attribute.)
Public methodMatch (Inherited from Attribute.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodThrowIfNull
Throws a NullReferenceException if the object is null.
(Defined by ObjectExtensions.)
Top
Explicit Interface Implementations
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;
}
See Also