Odin Inspector 系列教程 --- Label Text Attribute

Label Text Attribute:用于更改屬性的標簽。如果您想要的標簽與屬性名稱不同,請使用此標簽。

同樣可以通過$特殊符指定某個屬性的值作為實參,也已經通過@直接書寫表達式
using Sirenix.OdinInspector;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LabelTextAttributeExample : MonoBehaviour
{
    [LabelText("1")]
    public int MyInt1;

    [LabelText("2")]
    public int MyInt2;

    [LabelText("3")]
    public int MyInt3;

    [InfoBox("Use $ to refer to a member string.")]
    [LabelText("$LabelText")]
    public string LabelText = "Dynamic label text";

    [InfoBox("Use @ to execute an expression.")]
    [LabelText("@DateTime.Now.ToString(\"HH:mm:ss\")")]
    public string DateTimeLabel;
}

更多教程內容詳見:革命性Unity 編輯器擴展工具 --- Odin Inspector 系列教程

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容