1. Using [InspectorName(" ")], the enumeration displayed in the Inspector panel is the content customized in the script.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public enum MentText
{
[InspectorName("第一")]
One,
[InspectorName("第二")]
Two,
[InspectorName("第三")]
Three
}
public class TextMenu : MonoBehaviour
{
//在Inspector面板显示的是定义的InspectorName中的内容
public MentText buJianState = MentText.One;
}
2. Hover the mouse over the attribute in the Inspector to display the content of the defined attribute.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class InstectorScript : MonoBehaviour
{
[Tooltip("在Inspector面板上鼠标悬停后可观察到的信息")]
public Transform Trans_Info;
}