docs.unity3d.com
    目次を表示する/隠す

    Class DisplayNameAttribute

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

    Inheritance
    Object
    Attribute
    DisplayNameAttribute
    Namespace: UnityEngine.Localization
    Syntax
    [AttributeUsage(AttributeTargets.All, AllowMultiple = false)]
    public class DisplayNameAttribute : Attribute, _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

    DisplayNameAttribute(String, String)

    Specify a custom name to display in the Editor.

    Declaration
    public DisplayNameAttribute(string name, string iconPath = null)
    Parameters
    Type Name Description
    String name

    The name to display.

    String iconPath

    Optional icon to display when possible.

    Properties

    IconPath

    Path to a Texture file to display as an icon.

    Declaration
    public string IconPath { get; set; }
    Property Value
    Type Description
    String

    Name

    The custom name to use when displayed in the Editor.

    Declaration
    public string Name { get; set; }
    Property Value
    Type Description
    String
    トップに戻る
    Copyright © 2023 Unity Technologies — 商標と利用規約
    • 法律関連
    • プライバシーポリシー
    • クッキー
    • 私の個人情報を販売または共有しない
    • Your Privacy Choices (Cookie Settings)