public override void OnInspectorGUI() { serializedObject.Update(); CustomListInspector.Show(mListProperty); GUILayout.Space(10); CustomListInspector.Show(mSubProperty); GUILayout.Space(10); CustomListInspector.Show(mRTProperty); GUILayout.Space(10); EditorGUILayout.PropertyField(serializedObject.FindProperty("RootTransform")); serializedObject.ApplyModifiedProperties(); Event e = Event.current; string commandName = e.commandName; if (mIsSelecting && e.type != EventType.Layout && commandName == "ObjectSelectorUpdated") { setPickerObj(); } if (mIsSelecting && e.type != EventType.Layout && commandName == "ObjectSelectorClosed") { mIsSelecting = false; setPickerObj(true); } if (GUILayout.Button(new GUIContent("拷贝Index信息到剪贴板"))) { copyIndex2ClipboardLua(); } }
public override void OnInspectorGUI() { serializedObject.Update(); SerializedProperty dynamically = serializedObject.FindProperty("Dynamically"); EditorGUILayout.PropertyField(dynamically, new GUIContent("Dynamically", "是否动态创建Toggle\n如果是,需要TogglePrefab,不需要则要事先创建好toggle")); if (dynamically.boolValue) { SerializedProperty prefab = serializedObject.FindProperty("TogglePrefab"); EditorGUILayout.PropertyField(prefab, new GUIContent("Toogle Preafab", "如果不同位置Toggle有变化,需要在Toggle上加上UIHandler,通过SetData的方式改变,当前仅支持初始化时改变,\n如果没有变化直接SetTotalNum")); } else { SerializedProperty toggles = serializedObject.FindProperty("mToggls"); CustomListInspector.Show(toggles, new GUIContent("Toggles", "test")); if (toggles.arraySize == 0) { EditorGUILayout.HelpBox("请手动创建所有Toggle", MessageType.Warning); } } SerializedProperty callbackOnSet = serializedObject.FindProperty("CallbackOnSet"); EditorGUILayout.PropertyField(callbackOnSet, new GUIContent("Callback On Set", "通过SetCurIndex设置的当前选中toggle时是否回调通知")); EditorGUILayout.PropertyField(serializedObject.FindProperty("Group")); serializedObject.ApplyModifiedProperties(); }
//Editor 展示 public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(serializedObject.FindProperty("DebugPL")); EditorGUILayout.PropertyField(serializedObject.FindProperty("MainBtn")); EditorGUILayout.PropertyField(serializedObject.FindProperty("LogFreshInterval"), new GUIContent("日志刷新间隔")); EditorGUILayout.PropertyField(serializedObject.FindProperty("MaxLineNum"), new GUIContent("最大日志条数")); EditorGUILayout.PropertyField(serializedObject.FindProperty("LogSvIdx"), new GUIContent("日志Sv index")); CustomListInspector.Show(serializedObject.FindProperty("PagesIdx")); //EditorGUILayout.PropertyField(); GUILayout.Space(5); serializedObject.ApplyModifiedProperties(); base.OnInspectorGUI(); }