Exemplo n.º 1
0
 public static void ContrastGUI(VPaintLayerAction action)
 {
     VPaintGUIUtility.DrawColumnRow(24, () => {
         action.contrastAdjustment = EditorGUILayout.Slider("Contrast", action.contrastAdjustment, 0, 2f);
     });
     VPaintGUIUtility.DrawColumnRow(24, () => {
         action.contrastThreshhold = EditorGUILayout.Slider("Treshhold", action.contrastThreshhold, 0, 1f);
     });
 }
Exemplo n.º 2
0
        public static void SelectionGroup(string title, List <VPaintObject> objects, ref Vector2 scroll)
        {
            VPaintGUIUtility.DrawColumnRow(24,
                                           () => {
                GUILayout.Label(title);
                if (VPaintGUIUtility.FoldoutMenu())
                {
                    AddMenu(objects);
                }
            });

            bool doVAlign = vAlignRows;

            vAlignRows = false;

            var s = scroll;

            VPaintGUIUtility.DrawColumnRow(200,
                                           () => {
                s = EditorGUILayout.BeginScrollView(s);
                for (int i = 0; i < objects.Count; i++)
                {
                    var obj = objects[i];
                    var r   = EditorGUILayout.BeginHorizontal();
                    GUILayout.Label(obj.name);
                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button("X"))
                    {
                        objects.RemoveAt(i--);
                    }
                    EditorGUILayout.EndHorizontal();
                    if (r.Contains(Event.current.mousePosition) && Event.current.type == EventType.MouseDown && Event.current.button == 0)
                    {
                        EditorGUIUtility.PingObject(obj);
                    }
                }
                EditorGUILayout.EndScrollView();
            });
            scroll = s;

            vAlignRows = doVAlign;

            VPaintGUIUtility.DrawColumnRow(1, () => {});
        }
Exemplo n.º 3
0
        public static void TintColorGUI(VPaintLayerAction action)
        {
            VPaintGUIUtility.DrawColumnRow(24, () => {
                action.tintColor = EditorGUILayout.ColorField("Tint Color", action.tintColor);
            });
            VPaintGUIUtility.DrawColumnRow(24, () => {
                action.tintColorOpacity = EditorGUILayout.Slider("Opacity", action.tintColorOpacity, 0f, 1f);
            });

            EditorGUILayout.BeginHorizontal();
            VPaintGUIUtility.DrawColumnRow(24, () => {
                action.tintUseValue = EditorGUILayout.Toggle("Mask By Value", action.tintUseValue);
            },
                                           () => {
                action.tintInvertUseValue = EditorGUILayout.Popup(action.tintInvertUseValue ? 0 : 1,
                                                                  new string[] { "Screen", "Multiply" }) == 0;
            });
            EditorGUILayout.EndHorizontal();
        }
Exemplo n.º 4
0
        public void OnGUI()
        {
            Rect rect = EditorGUILayout.BeginVertical();

            VPaintGUIUtility.BoxArea(4, 4, 1, () => {
                EditorGUILayout.BeginVertical(GUILayout.Width(width));

                GUILayout.Space(5);

                EditorGUILayout.BeginHorizontal();

                GUILayout.Space(3);

                if (GUILayout.Button(foldout ? "-" : "+", GUILayout.Width(23), GUILayout.Height(12)))
                {
                    foldout = !foldout;
                }
                GUILayout.Space(4);
                title();

                EditorGUILayout.EndHorizontal();

                GUILayout.Space(7);

                if (foldout)
                {
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Space(leftMargin);
                    EditorGUILayout.BeginVertical();
                    method(rect);
                    EditorGUILayout.EndVertical();
                    EditorGUILayout.EndHorizontal();
                }

                EditorGUILayout.EndVertical();
            });
            EditorGUILayout.EndVertical();
        }
Exemplo n.º 5
0
        public static void DualSelectionGroup(
            string leftTitle, List <VPaintObject> leftObjects, ref Vector2 leftScroll,
            string rightTitle, List <VPaintObject> rightObjects, ref Vector2 rightScroll)
        {
            VPaintGUIUtility.DrawColumnRow(24,
                                           () => {
                GUILayout.Label(leftTitle);
                GUILayout.FlexibleSpace();
                if (VPaintGUIUtility.FoldoutMenu())
                {
                    AddMenu(leftObjects);
                }
            },
                                           () => {
                if (VPaintGUIUtility.FoldoutMenu())
                {
                    AddMenu(rightObjects);
                }
                GUILayout.FlexibleSpace();
                GUILayout.Label(rightTitle);
            });

            var ls = leftScroll;
            var rs = rightScroll;

            bool doVAlign = vAlignRows;

            vAlignRows = false;

            VPaintGUIUtility.DrawColumnRow(200,
                                           () => {
                ls = EditorGUILayout.BeginScrollView(ls);
                for (int i = 0; i < leftObjects.Count; i++)
                {
                    var obj = leftObjects[i];
                    var r   = EditorGUILayout.BeginHorizontal();
                    GUILayout.Label(obj.name);
                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button("X"))
                    {
                        leftObjects.RemoveAt(i--);
                    }
                    EditorGUILayout.EndHorizontal();
                    if (r.Contains(Event.current.mousePosition) && Event.current.type == EventType.MouseDown && Event.current.button == 0)
                    {
                        EditorGUIUtility.PingObject(obj);
                    }
                }
                EditorGUILayout.EndScrollView();
            },
                                           () => {
                rs = EditorGUILayout.BeginScrollView(rs);
                for (int i = 0; i < rightObjects.Count; i++)
                {
                    var obj = rightObjects[i];
                    var r   = EditorGUILayout.BeginHorizontal();
                    GUILayout.Label(obj.name);
                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button("X"))
                    {
                        rightObjects.RemoveAt(i--);
                    }
                    EditorGUILayout.EndHorizontal();

                    if (r.Contains(Event.current.mousePosition) && Event.current.type == EventType.MouseDown && Event.current.button == 0)
                    {
                        EditorGUIUtility.PingObject(obj);
                    }
                }
                EditorGUILayout.EndScrollView();
            });

            vAlignRows = doVAlign;

            leftScroll  = ls;
            rightScroll = rs;

            VPaintGUIUtility.DrawColumnRow(1, () => {}, () => {});
        }
Exemplo n.º 6
0
 public static void OpacityGUI(VPaintLayerAction action)
 {
     VPaintGUIUtility.DrawColumnRow(24, () => {
         action.opacityAdjustment = EditorGUILayout.Slider("Opacity", action.opacityAdjustment, 0, 2);
     });
 }
Exemplo n.º 7
0
 public static void SaturationGUI(VPaintLayerAction action)
 {
     VPaintGUIUtility.DrawColumnRow(24, () => {
         action.saturationAdjustment = EditorGUILayout.Slider("Saturation", action.saturationAdjustment, 0, 2);
     });
 }
Exemplo n.º 8
0
 public static void HueShiftGUI(VPaintLayerAction action)
 {
     VPaintGUIUtility.DrawColumnRow(24, () => {
         action.hueAdjustment = EditorGUILayout.Slider("Hue", action.hueAdjustment, 0, 360);
     });
 }
Exemplo n.º 9
0
 public static void BrightnessGUI(VPaintLayerAction action)
 {
     VPaintGUIUtility.DrawColumnRow(24, () => {
         action.brightnessAdjustment = EditorGUILayout.Slider("Brightness", action.brightnessAdjustment, 0, 2);
     });
 }