Ejemplo n.º 1
0
    public override void DrawGUI(Rect rect)
    {
        UpdateModes();
        //update rects
        UpdateRects(rect);
        //tab buttons
        Matrix4x4 matrix = GUI.matrix;

        GUIUtility.RotateAroundPivot(270, _rect_submodes.center);
        int newmode = GUI.SelectionGrid(VxlGUI.CenterInvertRect(_rect_submodes), _mode, _mode_labels, _modes.Length, GUI.skin.GetStyle("SubModeToolbar"));

        //mode switch
        if (newmode != _mode)
        {
            //disable old mode
            _modes[_mode].Disable();
            //enable new mode
            _modes[newmode].Enable();
            _mode = newmode;
            //update new mode
            UpdateModes();
        }
        GUI.matrix = matrix;
        //tab content
        if (_mode >= 0 && _mode < _modes.Length)
        {
            _modes[_mode].DrawGUI(_rect_content);
        }
        //selection background
        VxlGUI.DrawRect(_rect_selected, "DarkGradient");
        //selection label
        string text = "[None]";

        if (selected != null)
        {
            text = selected.objname;
        }
        GUI.Label(_rect_selected, _title + ":  " + text, GUI.skin.GetStyle("LeftLightHeader"));

        UpdateModes();
    }