private void OnSceneGUI(SceneView sceneView)
 {
     AdjustPosition.Execute();
     if (_ruler != null)
     {
         _ruler.OnSceneGUI(sceneView);
     }
 }
        private void OnGUI()
        {
            EditorGUILayout.BeginHorizontal();
            DrawButton("align_left", AlignTools.AlignLeft, "Align Left");
            DrawButton("align_center_h", AlignTools.AlignCenterH, "Align Center by Horizontal");
            DrawButton("align_right", AlignTools.AlignRight, "Align Right");
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            DrawButton("align_top", AlignTools.AlignTop, "Align Top");
            DrawButton("align_center_v", AlignTools.AlignCenterV, "Align Center by Vertical");
            DrawButton("align_bottom", AlignTools.AlignBottom, "Align Bottom");
            EditorGUILayout.EndHorizontal();

            DrawLine();
            EditorGUILayout.BeginHorizontal();
            DrawButton("distribution_h", AlignTools.DistributionGapHorizontal, "Distribute by Horizontal");
            DrawButton("distribution_v", AlignTools.DistributionGapVertical, "Distribute by Vertical");
            EditorGUILayout.EndHorizontal();

            DrawLine();
            EditorGUILayout.BeginHorizontal();
            DrawButton("expand_h", AlignTools.ExpandWidth, "Expand Size by Horizontal");
            DrawButton("expand_v", AlignTools.ExpandHeight, "Expand Size by Vertical");
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            DrawButton("shrink_h", AlignTools.ShrinkWidth, "Shrink Size by Horizontal");
            DrawButton("shrink_v", AlignTools.ShrinkHeight, "Shrink Size by Vertical");
            EditorGUILayout.EndHorizontal();


            DrawLine();
            Settings.AdjustPositionByKeyboard = EditorGUILayout.ToggleLeft("Adjust Position By Keyboard", Settings.AdjustPositionByKeyboard);
            DrawLine();
            if (null == _ruler)
            {
                _ruler = new Ruler();
            }
            EditorGUI.BeginChangeCheck();
            Settings.ShowRuler = EditorGUILayout.ToggleLeft("Show Ruler", Settings.ShowRuler);
            var needPepaintScene = EditorGUI.EndChangeCheck();

            if (Settings.ShowRuler)
            {
                EditorGUI.BeginChangeCheck();
                Settings.RulerLineColor = EditorGUILayout.ColorField("Ruler Line Color", Settings.RulerLineColor);
                needPepaintScene        = EditorGUI.EndChangeCheck() || needPepaintScene;
            }


            AdjustPosition.Execute();
            if (needPepaintScene)
            {
                SceneView.RepaintAll();
            }
        }
示例#3
0
        private void OnGUI()
        {
            if (editorPath == null)
            {
                editorPath = System.IO.Path.GetDirectoryName(AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(this)));
            }

            EditorGUILayout.BeginHorizontal();
            DrawButton("align_left", AlignTools.AlignLeft, "Align Left");
            DrawButton("align_center_h", AlignTools.AlignCenterH, "Align Center by Horizontal");
            DrawButton("align_right", AlignTools.AlignRight, "Align Right");
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            DrawButton("align_top", AlignTools.AlignTop, "Align Top");
            DrawButton("align_center_v", AlignTools.AlignCenterV, "Align Center by Vertical");
            DrawButton("align_bottom", AlignTools.AlignBottom, "Align Bottom");
            EditorGUILayout.EndHorizontal();

            DrawLine();
            EditorGUILayout.BeginHorizontal();
            DrawButton("distribution_h", AlignTools.DistributionHorizontal, "Distribute by Horizontal");
            DrawButton("distribution_v", AlignTools.DistributionVertical, "Distribute by Vertical");
            EditorGUILayout.EndHorizontal();

            DrawLine();
            EditorGUILayout.BeginHorizontal();
            DrawButton("expand_h", AlignTools.ExpandWidth, "Expand Size by Horizontal");
            DrawButton("expand_v", AlignTools.ExpandHeight, "Expand Size by Vertical");
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.BeginHorizontal();
            DrawButton("shrink_h", AlignTools.ShrinkWidth, "Shrink Size by Horizontal");
            DrawButton("shrink_v", AlignTools.ShrinkHeight, "Shrink Size by Vertical");
            EditorGUILayout.EndHorizontal();


            DrawLine();
            Settings.AdjustPositionByKeyboard = EditorGUILayout.ToggleLeft("Adjust Position By Keyboard", Settings.AdjustPositionByKeyboard);

            AdjustPosition.Execute();
        }
 private void OnHierarchyWindowItemOnGUI(int instanceID, Rect selectionRect)
 {
     AdjustPosition.Execute();
 }
示例#5
0
 private void OnSceneGUI(SceneView sceneView)
 {
     AdjustPosition.Execute();
 }