예제 #1
0
    public override void DrawGUI(Rect rect)
    {
        //update and populate lists
        UpdateLists();
        //update layout rects
        UpdateLayoutRect(rect);
        //draw header
        VxlGUI.DrawRect(_rect_header, "DarkGradient");
        GUI.Label(_rect_header, _title, GUI.skin.GetStyle("LeftLightHeader"));
        //GUID
        VxlGUI.DrawRect(_rect_guidscroll, "DarkWhite");
        _guidscroll = GUI.BeginScrollView(_rect_guidscroll, _guidscroll, _rect_guidcontent);
        _guidlist.DoList(_rect_guidcontent);
        GUI.EndScrollView();
        //transfer panel
        bool disable_guid = _guidlist.index < 0 || _guidlist.index >= _guidlist.count;
        bool disable_lib  = _libobjlist.index < 0 || _libobjlist.index >= _libobjlist.count;

        VxlGUI.DrawRect(_rect_panel, "DarkGradient");
        float boundwidth = Mathf.Min(60f, _rect_panel.width / 3f);
        //down button
        Rect rect_button = VxlGUI.GetMiddleX(VxlGUI.GetLeftElement(_rect_panel, 0, boundwidth), _rect_panel.height);

        EditorGUI.BeginDisabledGroup(disable_guid);
        if (GUI.Button(rect_button, "", GUI.skin.GetStyle("ArrowDown")))
        {
            AddSelected();
        }
        EditorGUI.EndDisabledGroup();
        //up button
        rect_button = VxlGUI.GetMiddleX(VxlGUI.GetMiddleX(_rect_panel, boundwidth), _rect_panel.height);
        EditorGUI.BeginDisabledGroup(disable_lib);
        if (GUI.Button(rect_button, "", GUI.skin.GetStyle("ArrowUp")))
        {
            RemoveSelected();
        }
        EditorGUI.EndDisabledGroup();
        //swap button
        rect_button = VxlGUI.GetMiddleX(VxlGUI.GetRightElement(_rect_panel, 0, boundwidth), _rect_panel.height);
        EditorGUI.BeginDisabledGroup(disable_guid || disable_lib);
        if (GUI.Button(rect_button, "", GUI.skin.GetStyle("ArrowSwap")))
        {
            SwapSelected();
        }
        EditorGUI.EndDisabledGroup();
        //library
        VxlGUI.DrawRect(_rect_libscroll, "DarkWhite");
        _libscroll = GUI.BeginScrollView(_rect_libscroll, _libscroll, _rect_libcontent);
        _libobjlist.DoList(_rect_libcontent);
        GUI.EndScrollView();
    }