如图: 定义属性描述特性(因为没有描述的数据,让绘制类去绘制所以为空) using UnityEngine; using System.Collections; public class EnumFlagsAttribute : PropertyAttribute {} 自定义属性绘制类: using UnityEngine; using System.Collections; using UnityEditor; [CustomPropertyDrawer(typeof(EnumFlagsAt
首先是自定义 using UnityEngine; using System.Collections; using UnityEditor; public class EnumFlagsAttribute : PropertyAttribute {} [CustomPropertyDrawer(typeof(EnumFlagsAttribute))] public class EnumFlagsAttributeDrawer : PropertyDrawer { public override
用Handles可以直接在GUI下绘制贝塞尔 using UnityEditor; using UnityEngine; using System.Collections; public class GUIBezier : EditorWindow { Vector3 mOri; Vector3 mEnd; Vector3 mOriTang; Vector3 mEndTang; [MenuItem("GUIBezierTest/GUIBezier")] public static vo
枚举增强程序的可读性,用法上还是需要注意的 1.C语言的写法 enum XMPPReconnectFlags { kShouldReconnect = 1 << 0, // If set, disconnection was accidental, and autoReconnect may be used kMultipleChanges = 1 << 1, // If set, there have been reachability changes during a conn