Example #1
0
        private void DrawToolbar()
        {
            this.includeWarnings = EditorPrefs.GetBool("OdinValidation.includeWarnings", this.includeWarnings);
            this.includeErrors   = EditorPrefs.GetBool("OdinValidation.includeErrors", this.includeErrors);
            this.includeValid    = EditorPrefs.GetBool("OdinValidation.includeValid", this.includeValid);

            AllEditorGUI.BeginHorizontalToolbar();
            {
                //GL.sRGBWrite = QualitySettings.activeColorSpace == ColorSpace.Linear;
                //this.includeValid = AllEditorGUI.ToolbarButton(new GUIContent("      " + this.validCount + " "), this.includeValid) ? !this.includeValid : this.includeValid;
                this.includeValid = AllEditorGUI.ToolbarToggle(this.includeValid, new GUIContent("      " + this.validCount + " "));
                GUIHelper.PushColor(Color.green);
                GUI.DrawTexture(new Rect(GUILayoutUtility.GetLastRect().position + new Vector2(6, 4), new Vector2(16, 16)), EditorIcons.Checkmark.Highlighted, ScaleMode.ScaleToFit);
                GUIHelper.PopColor();

                //this.includeWarnings = AllEditorGUI.ToolbarButton(new GUIContent("      " + this.warningCount + " "), this.includeWarnings) ? !this.includeWarnings : this.includeWarnings;
                this.includeWarnings = AllEditorGUI.ToolbarToggle(this.includeWarnings, new GUIContent("      " + this.warningCount + " "));
                GUI.DrawTexture(new Rect(GUILayoutUtility.GetLastRect().position + Vector2.one * 2, new Vector2(20, 20)), EditorIcons.UnityWarningIcon, ScaleMode.ScaleToFit);

                //this.includeErrors = AllEditorGUI.ToolbarButton(new GUIContent("      " + this.errorCount + " "), this.includeErrors) ? !this.includeErrors : this.includeErrors;
                this.includeErrors = AllEditorGUI.ToolbarToggle(this.includeErrors, new GUIContent("      " + this.errorCount + " "));
                GUI.DrawTexture(new Rect(GUILayoutUtility.GetLastRect().position + Vector2.one * 2, new Vector2(22, 22)), EditorIcons.UnityErrorIcon, ScaleMode.ScaleToFit);
                //GL.sRGBWrite = false;

                GUILayout.FlexibleSpace();

                if (AllEditorGUI.ToolbarButton(GUIHelper.TempContent("  Scan Scene  ")))
                {
                    this.FullScan();
                }
            }
            AllEditorGUI.EndHorizontalToolbar();

            EditorPrefs.SetBool("OdinValidation.includeWarnings", this.includeWarnings);
            EditorPrefs.SetBool("OdinValidation.includeErrors", this.includeErrors);
            EditorPrefs.SetBool("OdinValidation.includeValid", this.includeValid);
        }