SuffixLabelAttribute

The SuffixLabel attribute draws a label at the end of a property.

Use this for conveying intend about a property. Is the distance measured in meters, kilometers, or in light years?. Is the angle measured in degrees or radians? Using SuffixLabel, you can place a neat label at the end of a property, to clearly show how the the property is used.

namespace Sirenix.OdinInspector
{
[AttributeUsageAttribute((AttributeTargets)448, AllowMultiple = True, Inherited = False)]
public sealed class SuffixLabelAttribute : Attribute
}

Requirements

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector
Version: 1.0.6.1

See Also

Constructors

Definition Description
SuffixLabelAttribute(string, bool) Draws a label at the end of the property.

Properties

Return Type Definition Description
string Label The label displayed at the end of the property.
bool Overlay If true the suffix label will be drawn on top of the property, instead of after.

Example

The following examples demonstrates how SuffixLabel is used.

public class MyComponent : MonoBehaviour
{
	// The SuffixLabel attribute draws a label at the end of a property.
	// It's useful for conveying intend about a property.
	// Fx, this field is supposed to have a prefab assigned.
	[SuffixLabel("Prefab")]
	public GameObject GameObject;

	// Using the Overlay property, the suffix label will be drawn on top of the property instead of behind it.
	// Use this for a neat inline look.
	[SuffixLabel("ms", Overlay = true)]
	public float Speed;

	[SuffixLabel("radians", Overlay = true)]
	public float Angle;

	// The SuffixLabel attribute also supports string member references by using $.
	[SuffixLabel("$Suffix", Overlay = true)]
	public string Suffix = "Dynamic suffix label";
}