大家好,又见面了,我是你们的朋友全栈君。
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 系列教程
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/162792.html原文链接:https://javaforall.net
