コード例 #1
0
    /// <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);
    }
コード例 #2
0
    /// <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);
    }