Пример #1
0
 static void PrepareShow(bool hdr)
 {
     if (s_GradientPicker == null)
     {
         string title = hdr ? "HDR Gradient Editor" : "Gradient Editor";
         s_GradientPicker = (GradientPicker)GetWindow(typeof(GradientPicker), true, title, false);
         Vector2 minSize = new Vector2(360, 224);
         Vector2 maxSize = new Vector2(1900, 3000);
         s_GradientPicker.minSize        = minSize;
         s_GradientPicker.maxSize        = maxSize;
         s_GradientPicker.wantsMouseMove = true;
         s_GradientPicker.ShowAuxWindow(); // Use this if auto close on lost focus is wanted.
     }
     else
     {
         s_GradientPicker.Repaint(); // Ensure we get a OnGUI so we refresh if new gradient
     }
 }
Пример #2
0
        static void PrepareShow(bool hdr, ColorSpace colorSpace)
        {
            if (s_GradientPicker == null)
            {
                string title = hdr ? "HDR Gradient Editor" : "Gradient Editor";
                if (colorSpace == ColorSpace.Linear)
                {
                    title += " (linear)";
                }
                s_GradientPicker = (GradientPicker)GetWindow(typeof(GradientPicker), true, title, false);
                Vector2 minSize = new Vector2(360, 224);
                Vector2 maxSize = new Vector2(1900, 3000);
                s_GradientPicker.minSize        = minSize;
                s_GradientPicker.maxSize        = maxSize;
                s_GradientPicker.wantsMouseMove = true;
                Undo.undoRedoPerformed         += s_GradientPicker.OnUndoPerformed;
            }

            s_GradientPicker.ShowAuxWindow(); // Use this if auto close on lost focus is wanted.
        }
Пример #3
0
        public static void Show(Gradient newGradient)
        {
            GUIView current = GUIView.current;

            if (s_GradientPicker == null)
            {
                s_GradientPicker = (GradientPicker)EditorWindow.GetWindow(typeof(GradientPicker), true, "Gradient Editor", false);
                Vector2 vector  = new Vector2(360f, 224f);
                Vector2 vector2 = new Vector2(1900f, 3000f);
                s_GradientPicker.minSize        = vector;
                s_GradientPicker.maxSize        = vector2;
                s_GradientPicker.wantsMouseMove = true;
                s_GradientPicker.ShowAuxWindow();
            }
            else
            {
                s_GradientPicker.Repaint();
            }
            s_GradientPicker.m_DelegateView = current;
            s_GradientPicker.Init(newGradient);
        }
Пример #4
0
 public static void Show(Gradient newGradient)
 {
     GUIView current = GUIView.current;
     if (s_GradientPicker == null)
     {
         s_GradientPicker = (GradientPicker) EditorWindow.GetWindow(typeof(GradientPicker), true, "Gradient Editor", false);
         Vector2 vector = new Vector2(360f, 224f);
         Vector2 vector2 = new Vector2(1900f, 3000f);
         s_GradientPicker.minSize = vector;
         s_GradientPicker.maxSize = vector2;
         s_GradientPicker.wantsMouseMove = true;
         s_GradientPicker.ShowAuxWindow();
     }
     else
     {
         s_GradientPicker.Repaint();
     }
     s_GradientPicker.m_DelegateView = current;
     s_GradientPicker.Init(newGradient);
 }