using UnityEditor; [CustomEditor(typeof(UILongClickButton), false)] public class MyButtonEditor : Editor { private SerializedProperty mBtnType; private void OnEnable() { mBtnType = serializedObject.FindProperty("mBtnType"); } }