예제 #1
0
    public bool Toggle(string text, bool open, bool allowCollapse = true)
    {
        var result = GUIHelpers.DoToolbar(text, open);

        if (open || result)
        {
            EditorGUILayout.Space();
            if (result)
            {
                return(!open);
            }
        }

        return(open);
    }
예제 #2
0
    public bool Toggle(string text, bool open, bool allowCollapse = true)
    {
        var result = GUIHelpers.DoToolbar(text, open);

        if (open || result)
        {
            EditorGUILayout.Space();
            if (result)
            {
                return(!open);
            }
        }

        return(open);
        //var rect = UBEditor.GetRect(UBStyles.SubHeaderStyle);
        //var result = GUI.Toggle(rect, open,allowCollapse ? (open ? "- " : "+ ") + text : text, UBStyles.SubHeaderStyle);

        //return result;
    }