docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class DisplayNameAttribute

    Specify a custom name to be used when displayed in the Editor.

    Inheritance
    object
    Attribute
    DisplayNameAttribute
    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.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)