示例#1
0
        static void OnGUIContentsJustify(bool isSceneGUI, SelectedBrushSurface[] selectedBrushSurfaces)
        {
            GUILayout.BeginVertical(CSG_GUIStyleUtility.ContentEmpty);
            {
                if (!isSceneGUI)
                {
                    GUILayout.BeginHorizontal(CSG_GUIStyleUtility.ContentEmpty);
                    EditorGUILayout.LabelField(ContentJustifyLabel, largeLabelWidth);
                }
                else
                {
                    GUILayout.Label(ContentJustifyLabel);
                }
                GUILayout.BeginVertical(CSG_GUIStyleUtility.ContentEmpty);
                {
                    GUILayout.BeginHorizontal(CSG_GUIStyleUtility.ContentEmpty);
                    {
                        if (GUILayout.Button(ContentJustifyUpLeft, justifyButtonLayout))
                        {
                            SurfaceUtility.JustifyLayout(selectedBrushSurfaces, -1, -1);
                        }
                        TooltipUtility.SetToolTip(ToolTipJustifyUpLeft);
                        if (GUILayout.Button(ContentJustifyUp, justifyButtonLayout))
                        {
                            SurfaceUtility.JustifyLayoutY(selectedBrushSurfaces, -1);
                        }
                        TooltipUtility.SetToolTip(ToolTipJustifyUp);
                        if (GUILayout.Button(ContentJustifyUpRight, justifyButtonLayout))
                        {
                            SurfaceUtility.JustifyLayout(selectedBrushSurfaces, 1, -1);
                        }
                        TooltipUtility.SetToolTip(ToolTipJustifyUpRight);
                    }
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(CSG_GUIStyleUtility.ContentEmpty);
                    {
                        if (GUILayout.Button(ContentJustifyLeft, justifyButtonLayout))
                        {
                            SurfaceUtility.JustifyLayoutX(selectedBrushSurfaces, -1);
                        }
                        TooltipUtility.SetToolTip(ToolTipJustifyLeft);
                        if (GUILayout.Button(ContentJustifyCenter, justifyButtonLayout))
                        {
                            SurfaceUtility.JustifyLayout(selectedBrushSurfaces, 0, 0);
                        }
                        TooltipUtility.SetToolTip(ToolTipJustifyCenter);
                        if (GUILayout.Button(ContentJustifyRight, justifyButtonLayout))
                        {
                            SurfaceUtility.JustifyLayoutX(selectedBrushSurfaces, 1);
                        }
                        TooltipUtility.SetToolTip(ToolTipJustifyRight);
                    }
                    GUILayout.EndHorizontal();

                    GUILayout.BeginHorizontal(CSG_GUIStyleUtility.ContentEmpty);
                    {
                        if (GUILayout.Button(ContentJustifyDownLeft, justifyButtonLayout))
                        {
                            SurfaceUtility.JustifyLayout(selectedBrushSurfaces, -1, 1);
                        }
                        TooltipUtility.SetToolTip(ToolTipJustifyDownLeft);
                        if (GUILayout.Button(ContentJustifyDown, justifyButtonLayout))
                        {
                            SurfaceUtility.JustifyLayoutY(selectedBrushSurfaces, 1);
                        }
                        TooltipUtility.SetToolTip(ToolTipJustifyDown);
                        if (GUILayout.Button(ContentJustifyDownRight, justifyButtonLayout))
                        {
                            SurfaceUtility.JustifyLayout(selectedBrushSurfaces, 1, 1);
                        }
                        TooltipUtility.SetToolTip(ToolTipJustifyDownRight);
                    }
                    GUILayout.EndHorizontal();
                }
                GUILayout.EndVertical();

                if (!isSceneGUI)
                {
                    GUILayout.EndHorizontal();
                }
            }
            GUILayout.EndVertical();
        }