Class DisplayNameAttribute
Specify a custom name to be used when displayed in the Editor.
Namespace: UnityEngine.Localization
Assembly: Unity.Localization.dll
Syntax
[AttributeUsage(AttributeTargets.All, AllowMultiple = false)]
public class DisplayNameAttribute : Attribute
Examples
This example shows how Metadata can be given a custom name.
using System;
using UnityEngine.Localization;
using UnityEngine.Localization.Metadata;
/// <summary>
/// When displayed in the Inspector, such as the add metadata menu, the name will be displayed as "My Custom Name".
/// By default the name would have been "Metadata With Display Name".
/// </summary>
[DisplayName("My Custom Name")]
[Serializable]
public class MetadataWithDisplayName : IMetadata {}
Constructors
Name | Description |
---|---|
DisplayNameAttribute(string, string) | Specify a custom name to display in the Editor. |
Properties
Name | Description |
---|---|
IconPath | Path to a Texture file to display as an icon. |
Name | The custom name to use when displayed in the Editor. |