Exemple #1
0
        void DrawPostProcessingModelButton(string label, string name, PostProcessingModelFake model, EditorWindow window, Rect rect)
        {
            // if ()
            if (model != null && model.enabled)
            {
                EditorGUI.DrawRect(rect, new Color(0.33f, 0.6f, 0.8f, 0.4f));
            }
            EditorGUIUtility.AddCursorRect(rect, MouseCursor.Link);
            if (GUI.Button(rect, Params.CONTENT(label, "enable/disable " + label.Replace('\n', ' ')), Params.Button))
            {
                Undo.RecordObject(profile, "enable/disable " + label);

                if (model == null)
                {
                    AddModel(name, profile).enabled = true;
                }
                else
                {
                    model.enabled = !model.enabled;
                }

                EditorUtility.SetDirty(profile);

                Params.RepaintImages();
            }
        } //! TOP FAST BUTTIONS
 void DrawPostProcessingModelButton(string name, PostProcessingModelFake model, EditorWindow window, Rect rect)
 {
     if (model.enabled)
     {
         EditorGUI.DrawRect(rect, new Color(0.33f, 0.6f, 0.8f, 0.4f));
     }
     EditorGUIUtility.AddCursorRect(rect, MouseCursor.Link);
     if (Params.TransparentButton(rect, Params.CONTENT(name, "enable/disable " + name.Replace('\n', ' '))))
     {
         Undo.RecordObject(profile, "enable/disable " + name);
         model.enabled = !model.enabled;
         EditorUtility.SetDirty(profile);
         Params.RepaintImages();
     }
 } //! TOP FAST BUTTIONS
Exemple #3
0
        void DrawPostProcessingModelButton(string name, PostProcessingModelFake model, EditorWindow window, float leftWidth)
        {
            var rect = EditorGUILayout.GetControlRect(GUILayout.Width(Math.Min((window.position.width - leftWidth - 10 - 40) / 7, 100)), GUILayout.Height(40));

            if (model.enabled)
            {
                EditorGUI.DrawRect(rect, new Color(0.33f, 0.6f, 0.8f, 0.4f));
            }
            EditorGUIUtility.AddCursorRect(rect, MouseCursor.Link);
            if (GUI.Button(rect, Params.CONTENT(name, "enable/disable " + name.Replace('\n', ' ')), Params.Button))
            {
                Undo.RecordObject(profile, "enable/disable " + name);
                model.enabled = !model.enabled;
                EditorUtility.SetDirty(profile);
                window.Repaint();
            }
        } //! TOP FAST BUTTIONS