Hide Label Attribute特性:用于任何屬性,并在Inspector中中隱藏標(biāo)簽。使用此選項(xiàng)可隱藏Inspector中的屬性標(biāo)簽。
也就是把字段的名稱隱藏,只留下value
完成示例代碼
using Sirenix.OdinInspector;
using UnityEngine;
public class HideLabelExample : MonoBehaviour
{
public string showLabel = "菜鳥海瀾";
[HideLabel]
public string hideLabel = "隱藏標(biāo)題";
[ShowInInspector]
public string ShowPropertyLabel { get; set; }
[HideLabel][ShowInInspector]
public string HidePropertyLabel { get; set; }
}