/// <summary> /// 绘制折页 /// </summary> /// <param name="taget"></param> /// <param name="name"></param> /// <param name="drawGUI"></param> public static void DrawFoldout(object taget, string name, CallBack drawGUI) { bool isFolder = EditorGUILayout.Foldout(EditorGUIState.GetState(taget), name); if (isFolder) { if (drawGUI != null) { drawGUI(); } } EditorGUIState.SetState(taget, isFolder); }
/// <summary> /// 绘制折页 /// </summary> /// <param name="taget"></param> /// <param name="name"></param> /// <param name="drawGUI"></param> public static void DrawFoldout(object taget, GUIContent content, CallBack drawGUI) { bool isFolder = EditorGUILayout.Foldout(EditorGUIState.GetState(taget), content); if (isFolder) { if (drawGUI != null) { drawGUI(); } } EditorGUIState.SetState(taget, isFolder); }