2021-09-13
作者:互联网
unity常用特性
[Range(1f,5f)]
[RequireComponent(typeof(Transform)]
[Tooltip(" a tips")]
[HideInInspector] //一个可以被序列化的字段,不需要显示在Inspector面板中
[DisallowMultipleComponent] //禁止一个组件重复添加多次
[TextArea(1,5)] //长字符串编辑
[Multiline] //多行文本
[ContextMenu("Do something")] //执行一条指令,只能用于非静态函数
[MenuItem("Tools/普通的顶部菜单")] //只能用于静态方法
[ContextMenuItem("Reset","ResetString")] //为字段添加快捷菜单
[AddCompontentMenu("zcl/test")]
[SerializeField] //强制序列化私有字段
[Header("HeaderInfo")]
[ColorUsage] //color picker ,只能用在 Color字段上
[Delay]
[Space(50)]
[HelpURL("http:baidu.com")] //类前
[CreateAssetMenu(fileName="xxx",menuName="xxx/xxx")] //ScriptableObject 派生类实例,并存储为 ".asset"文件
[RuntimeInitializeOnLoadMethod] //在Awake之后执行的静态函数
[PreferBinarySerialization] //序列化为二进制,而不是 YAML
[GUITarget(0,1,new int[]{2,3,4})] //OnGUI方法在哪一个Display下显示
[SharedBetweenAnimators]
[SelectionBase]
[AssemblyEditorAssembly] //添加该特性的任意类,都会被视为Editor编辑器类
标签:只能,13,xxx,静态,09,添加,2021,序列化,菜单 来源: https://blog.csdn.net/weixin_36961960/article/details/120260394